v1.25.4 #25
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: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and Push latest to Docker Hub | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 | |
tags: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/nginx:latest | |
${{ secrets.DOCKER_HUB_USERNAME }}/nginx:${{ env.RELEASE_VERSION }} | |
ghcr.io/${{ env.REPO }}/nginx:latest | |
ghcr.io/${{ env.REPO }}/nginx:${{ env.RELEASE_VERSION }} |