| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- name: Publish Docker Image
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
- on:
- push:
- branches:
- - main
- tags:
- - '*'
- pull_request:
- workflow_dispatch:
- inputs:
- reason:
- description: 'Reason for manual trigger'
- required: true
- default: ''
- jobs:
- ghcr_build_and_push:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- strategy:
- matrix:
- image: ["app", "sandbox"]
- steps:
- - name: checkout
- uses: actions/checkout@v4
- - name: Free Disk Space (Ubuntu)
- uses: jlumbroso/free-disk-space@main
- with:
- # this might remove tools that are actually needed,
- # if set to "true" but frees about 6 GB
- tool-cache: true
- # all of these default to true, but feel free to set to
- # "false" if necessary for your workflow
- android: true
- dotnet: true
- haskell: true
- large-packages: true
- docker-images: false
- swap-storage: true
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v3
- - name: Login to ghcr
- uses: docker/login-action@v1
- with:
- registry: ghcr.io
- username: ${{ github.repository_owner }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Build and push ${{ matrix.image }}
- if: "!github.event.pull_request.head.repo.fork"
- run: |
- ./containers/build.sh ${{ matrix.image }} ${{ github.repository_owner }} --push
- - name: Build ${{ matrix.image }}
- if: "github.event.pull_request.head.repo.fork"
- run: |
- ./containers/build.sh ${{ matrix.image }} ${{ github.repository_owner }}
- docker_build_success:
- name: Docker Build Success
- runs-on: ubuntu-latest
- needs: ghcr_build_and_push
- steps:
- - run: echo Done!
|