Skip to content

publish-to-ghcr

publish-to-ghcr #12

name: publish-to-ghcr
# on:
# push:
# branches:
# - main
on:
workflow_run:
workflows: ["verify"]
types:
- completed
permissions:
packages: write # Публикация в GitHub Container Registry
jobs:
publish-to-repo:
if: >
${{ github.event.workflow_run.conclusion == 'success'
&& github.event.workflow_run.head_branch == 'main'
&& github.event.workflow_run.event == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
file: ./deploy/docker/app/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/md-ship-app:latest