1.24.1 #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 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@v2 | |
- name: Get the current release version | |
id: vars | |
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag tfgco/iac-ci:latest | |
- name: Login to DockerHub Registry | |
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | |
- name: Push the latest Docker image | |
run: docker push tfgco/iac-ci:latest | |
- name: Tag the release Docker image | |
run: docker tag tfgco/iac-ci:latest tfgco/iac-ci:${{steps.vars.outputs.tag}} | |
- name: Push the tagged release Docker image | |
run: docker push tfgco/iac-ci:${{steps.vars.outputs.tag}} |