Skip to content

Commit

Permalink
Update docker_build_push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimth authored Aug 13, 2023
1 parent c3d0621 commit 81e4bac
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ env:
jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker-compose build --no-cache --force-rm

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test the Docker image
run: docker-compose up -d

push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
Expand All @@ -43,7 +43,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand All @@ -59,5 +59,18 @@ jobs:
with:
context: "{{defaultContext}}"
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/flask-volt-dashboard:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Get short SHA
id: get_sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"

- name: Create GitHub Release
if: success()
run: |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
VERSION="1.0.0+${{ steps.get_sha.outputs.sha }}"
gh release create $VERSION \
--title "Release $VERSION" \
--notes "Auto-generated release from GitHub Actions."

0 comments on commit 81e4bac

Please sign in to comment.