Release to Docker Hub #13
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: Release to Docker Hub | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: "Set up QEMU" | |
uses: docker/[email protected] | |
- name: "Set up Docker Buildx" | |
uses: docker/[email protected] | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: 'Get Previous tag' | |
id: get_tag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: latest # Optional fallback tag to use when no tag can be found | |
- name: Build and push Docker image | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
chash=${{ github.sha }} | |
version=${{ steps.get_tag.outputs.tag }} | |
push: true | |
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}, ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.get_tag.outputs.tag }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |