Skip to content

Commit

Permalink
feat: push the docker image to dockerhub as a tag as well
Browse files Browse the repository at this point in the history
This will prevent people from just using latest, and potentially breaking their application. Anything up to version 2.0.0 has been pushed as latest, so it will break anything beforet his
  • Loading branch information
bjarneo committed Aug 19, 2022
1 parent 056ee70 commit 861795f
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/publish_docker_image.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
name: Publish Docker image
on:
release:
types: [published]
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: hemmeligapp/hemmelig:latest
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get latest git tag
id: latest_tag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
with:
fallback: no-tag
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: hemmeligapp/hemmelig:latest
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: hemmeligapp/hemmelig:${{ steps.latest_tag.outputs.tag }}

0 comments on commit 861795f

Please sign in to comment.