Skip to content

Commit

Permalink
fix: build and publish fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kojicmarko committed Mar 8, 2024
1 parent c06493e commit 20e7180
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name: Build and Publish Docker image

on:
push:
branches: main
workflow_run:
workflows: ["Lint and Test"]
types:
- completed

jobs:
build-and-publish:
if: ${{ github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Login to Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: kojicmarko
password: ${{ secrets.GHCR_PAT }}
- name: Build and publish the Docker image
run: |
docker login --username kojicmarko --password-stdin ${{ secrets.GHCR_PAT }}
docker build . -t ghcr.io/kojicmarko/final-pyweb-ghcr:latest
docker push ghcr.io/kojicmarko/final-pyweb-ghcr:latest
docker push ghcr.io/kojicmarko/final-pyweb-ghcr:latest

0 comments on commit 20e7180

Please sign in to comment.