-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.96 KB
/
build_and_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build and push images
on:
push:
branches:
- master
schedule:
# every 1st day of every month
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '0 0 1 * *'
env:
DOCKER_REGISTRY: magicxor
DOCKER_IMAGE: tor-simple
jobs:
ubuntu_lts_repo:
name: Ubuntu LTS repo tor version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- id: get_build_info
run: |
docker build . --file=ubuntu_lts_repo/VersionInfo.Dockerfile --progress=plain --no-cache -t tor-version-info
package_versions=$(docker run --rm tor-version-info)
echo "PACKAGE_VERSIONS=$package_versions" >> $GITHUB_OUTPUT
echo "BUILD_DATE=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/build-push-action
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: ubuntu_lts_repo/.
no-cache: true
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:latest
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ steps.get_build_info.outputs.PACKAGE_VERSIONS }}
platforms: |
linux/amd64
linux/arm/v7
linux/arm64/v8
build-args: |
VERSION=${{ steps.get_build_info.outputs.PACKAGE_VERSIONS }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.get_build_info.outputs.BUILD_DATE }}
BUILD_PLATFORM=${{ runner.os }}/${{ runner.arch }}