Chronos.Service.Publish #7
This file contains hidden or 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
| # Publishes Docker images to GitHub Container Registry (ghcr.io). | |
| # Images can be referenced as: ghcr.io/bgu-nasa/chronos-api:latest | |
| name: Chronos.Service.Publish | |
| on: | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_PREFIX: ghcr.io/${{ github.repository_owner }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| include: | |
| - image: chronos-api | |
| dockerfile: src/Chronos.MainApi/Dockerfile | |
| - image: chronos-migrations | |
| dockerfile: src/Chronos.Data/migrations.Dockerfile | |
| - image: chronos-engine | |
| dockerfile: src/Chronos.Engine/Dockerfile | |
| - image: chronos-offboarding | |
| dockerfile: src/Chronos.Offboarding/Dockerfile | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_PREFIX }}/${{ matrix.image }} | |
| tags: | | |
| type=sha | |
| type=raw,value=latest | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| no-cache: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |