From ef4a03cd58c8dcd95acadb48fe266316c8d68df6 Mon Sep 17 00:00:00 2001 From: "Thomas P." Date: Mon, 27 May 2024 12:56:06 +0200 Subject: [PATCH] ci: add a workflow to build images --- .github/workflows/build-image.yaml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build-image.yaml diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml new file mode 100644 index 0000000..b38864c --- /dev/null +++ b/.github/workflows/build-image.yaml @@ -0,0 +1,38 @@ +name: Deploy Images to GHCR + +on: + release: + types: + - released + workflow_dispatch: + +permissions: + packages: write + contents: read + +jobs: + build-docker-image: + runs-on: ubuntu-latest + steps: + - name: 'Checkout repo' + uses: actions/checkout@main + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ghcr.io/${{ github.repository }}:${{ github.ref }}