Publish new Docker image #21
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 new Docker image | |
on: | |
release: | |
types: [published] | |
jobs: | |
dockerhub-build-push: | |
name: DockerHub Build and Push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get the current release version | |
id: vars | |
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) | |
- name: Login to DockerHub Registry | |
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | |
- name: Build and Push the latest Docker image | |
run: docker buildx build --push --platform linux/arm64,linux/amd64 -t tfgco/iac-ci:latest -t tfgco/iac-ci:${{steps.vars.outputs.tag}} . |