diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 000000000..1336b7473 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,58 @@ +name: Docker Release + +on: + push: + tags: + - "v*" + +permissions: + contents: read + packages: write + +jobs: + publish-images: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - image_name: multica-backend + dockerfile: Dockerfile + - image_name: multica-frontend + dockerfile: Dockerfile.web + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }} + flavor: | + latest=true + tags: | + type=semver,pattern={{version}} + + - name: Build and push ${{ matrix.image_name }} + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ matrix.dockerfile }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64