Skip to content

Build and Publish Docker image #22

Build and Publish Docker image

Build and Publish Docker image #22

name: "Build and Publish Docker image"
on:
pull_request:
types: [closed]
branches: [main]
workflow_run:
workflows: ["Lint and Test"]
types:
- completed
jobs:
build-and-publish:
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 build . -t ghcr.io/kojicmarko/final-pyweb-ghcr:latest
docker push ghcr.io/kojicmarko/final-pyweb-ghcr:latest