updating workflow to automate testing builds #73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |