No scoped token #2
Workflow file for this run
This file contains 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
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the source code | |
uses: actions/checkout@v4 | |
- name: Get current tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Build the Docker image | |
run: | | |
docker build . --file Dockerfile --tag dodancs/pdns-recursor:${{ env.RELEASE_VERSION }} | |
docker tag dodancs/pdns-recursor:${{ env.RELEASE_VERSION }} dodancs/pdns-recursor:latest | |
docker tag dodancs/pdns-recursor:${{ env.RELEASE_VERSION }} ghcr.io/dodancs/docker-pdns-recursor:${{ env.RELEASE_VERSION }} | |
docker tag dodancs/pdns-recursor:${{ env.RELEASE_VERSION }} ghcr.io/dodancs/docker-pdns-recursor:latest | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Log in to the ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push the Docker images | |
run: | | |
docker push dodancs/pdns-recursor:${{ env.RELEASE_VERSION }} | |
docker push dodancs/pdns-recursor:latest | |
docker push ghcr.io/dodancs/docker-pdns-recursor:${{ env.RELEASE_VERSION }} | |
docker push ghcr.io/dodancs/docker-pdns-recursor:latest |