Skip to content

1.24.1

1.24.1 #20

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}}