Publish Runtime #1
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
| name: Publish Runtime | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| image_tag: | |
| description: 'Container tag to publish to ghcr.io' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish-runtime: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Normalize image name | |
| id: image | |
| env: | |
| REPOSITORY_OWNER: ${{ github.repository_owner }} | |
| run: | | |
| echo "name=ghcr.io/${REPOSITORY_OWNER,,}/flora" >> "$GITHUB_OUTPUT" | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push runtime image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: apps/runtime/Dockerfile | |
| push: true | |
| tags: ${{ steps.image.outputs.name }}:${{ inputs.image_tag }} | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| cache-from: type=gha,scope=publish-runtime | |
| cache-to: type=gha,scope=publish-runtime,mode=max | |
| - name: Print published image | |
| run: echo "Published ${{ steps.image.outputs.name }}:${{ inputs.image_tag }}" |