forked from faicker/dnscrypt-proxy-2-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (51 loc) · 1.88 KB
/
docker-publish.yml
File metadata and controls
60 lines (51 loc) · 1.88 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
name: Build
on:
push:
branches: [ master, testing ]
workflow_dispatch:
inputs:
dnscrypt_proxy_release:
description: "DNSCrypt Proxy Release (blank = latest upstream)"
required: false
env:
REGISTRY: docker.io
IMAGE_NAME: xtr0py/dnscrypt-proxy-2-docker
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Determine DNSCrypt version
shell: bash
run: |
VERSION="${{ github.event.inputs.dnscrypt_proxy_release }}"
if [ -z "$VERSION" ]; then
VERSION="$(curl -fsSL https://api.github.com/repos/DNSCrypt/dnscrypt-proxy/releases/latest \
| python -c "import sys,json; print(json.load(sys.stdin)['tag_name'].lstrip('v'))")"
fi
echo "DNSCRYPT_PROXY_VERSION=$VERSION" >> "$GITHUB_ENV"
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker metadata (tags)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ env.DNSCRYPT_PROXY_VERSION }},enable=${{ github.ref_name == 'master' }}
type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
type=raw,value=testing,enable=${{ github.ref_name == 'testing' }}
type=raw,value=testing-${{ env.DNSCRYPT_PROXY_VERSION }},enable=${{ github.ref_name == 'testing' }}
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
build-args: RELEASE_TAG=${{ env.DNSCRYPT_PROXY_VERSION }}
tags: ${{ steps.meta.outputs.tags }}
push: true