-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c06493e
commit 20e7180
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
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
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 |