Skip to content

updating workflow to automate testing builds #73

updating workflow to automate testing builds

updating workflow to automate testing builds #73

name: Build
on:
push:
branches: [ master, testing ]
workflow_dispatch:
inputs:
dnscrypt_proxy_release:
description: "DNSCrypt Proxy Release (blank = use DNSCRYPT_PROXY_VERSION file)"
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="$(cat DNSCRYPT_PROXY_VERSION)"
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