v1.24.0 #20
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
name: Publish Docker image | |
on: | |
release: | |
types: [published] | |
jobs: | |
push_to_registries: | |
name: Push Docker image to multiple registries | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Get tag name only | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Get downcase repo | |
run: | | |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push latest to Docker Hub | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nginx:latest | |
- name: Build and Push tag to Docker Hub | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/nginx:amd64-${{ env.RELEASE_VERSION }} | |
- name: Build and Push latest to Git Hub | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ghcr.io/${{ env.REPO }}/nginx:latest | |
- name: Build and Push tag to Git Hub | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: ghcr.io/${{ env.REPO }}/nginx:amd64-${{ env.RELEASE_VERSION }} |