From e5c2cd50776368099e477ba892e8db00d52cf563 Mon Sep 17 00:00:00 2001 From: Sabith KS Date: Fri, 25 Oct 2024 12:27:13 -0700 Subject: [PATCH] Build container --- .github/workflows/container.yml | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 000000000..128376b6a --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,53 @@ +name: Build + +on: + workflow_dispatch: + push: + branches: + - "main" + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker: + name: Docker build + runs-on: ubuntu-latest + outputs: + image_tag: ${{ steps.meta.outputs.tags }} + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: 'linux/amd64,linux/arm64/v8' + tags: ${{ steps.meta.outputs.tags }} + push: true + provenance: false + labels: ${{ steps.meta.outputs.labels }} + build-args: |- + GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || github.sha }}