-
Notifications
You must be signed in to change notification settings - Fork 328
66 lines (64 loc) · 2.08 KB
/
Copy pathdocker.yaml
File metadata and controls
66 lines (64 loc) · 2.08 KB
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
63
64
65
66
# TODO(a.garipov): Refactor this workflow.
'name': Docker
# Permissions are disabled for all the jobs by default, and then overridden for
# specific jobs if needed. This is a recommended practice for security reasons,
# and also allows to avoid mistakes with permissions when creating new jobs.
#
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions.
'permissions': {}
'env':
'GO_VERSION': '1.26.4'
'on':
'push':
'tags':
- 'v*'
# Builds from the master branch will be pushed with the `dev` tag.
'branches':
- 'master'
'jobs':
'docker':
'if': |
${{ github.repository_owner != 'AdGuardSoftwareLimited' }}
'permissions':
'contents': 'read'
'runs-on': 'ubuntu-latest'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v6'
'with':
# Set to false to avoid GITHUB_TOKEN leaking.
#
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
'persist-credentials': false
- 'name': 'Set up Go'
'uses': 'actions/setup-go@v6'
'with':
'go-version': '${{ env.GO_VERSION }}'
- 'name': 'Set up Go modules cache'
'uses': 'actions/cache@v4'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v3'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v3'
'with':
'install': true
- 'name': 'Publish to Docker Hub'
'env':
'DOCKER_USER': ${{ secrets.DOCKER_USER }}
'DOCKER_PASSWORD': ${{ secrets.DOCKER_PASSWORD }}
'run': |-
set -e -u -x
docker login \
-u="${DOCKER_USER}" \
-p="${DOCKER_PASSWORD}" \
;
make \
DOCKER_IMAGE_NAME='adguard/dnsproxy' \
DOCKER_PUSH='1' \
VERBOSE='1' \
docker \
;