diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 629ae13a..3baa0202 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -67,3 +67,56 @@ jobs: tags: | ghcr.io/${{ env.GHCR_NAMESPACE }}/harmony:latest ghcr.io/${{ env.GHCR_NAMESPACE }}/harmony:${{ env.RELEASE_VERSION }} + + yggdrasil: + name: Yggdrasil image + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get release tag & build flags + if: github.event_name == 'release' # Only for GitHub releases + run: | + echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Containers + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Yggdrasil image + if: github.ref_name == 'main' || github.event_name == 'workflow_dispatch' + id: docker_build_monolith + uses: docker/build-push-action@v3 + with: + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + file: Dockerfile.yggdrasil + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ghcr.io/${{ env.GHCR_NAMESPACE }}/harmony-yggdrasil:${{ github.ref_name }} + + - name: Build release Yggdrasil image + if: github.event_name == 'release' # Only for GitHub releases + id: docker_build_monolith_release + uses: docker/build-push-action@v3 + with: + cache-from: type=gha + cache-to: type=gha,mode=max + context: . + file: Dockerfile.yggdrasil + platforms: ${{ env.PLATFORMS }} + push: true + tags: | + ghcr.io/${{ env.GHCR_NAMESPACE }}/harmony-yggdrasil:latest + ghcr.io/${{ env.GHCR_NAMESPACE }}/harmony-yggdrasil:${{ env.RELEASE_VERSION }}