From 6c70cc90c55fd13d32af01008190e34e769607d2 Mon Sep 17 00:00:00 2001 From: Vaibhav Pandey Date: Mon, 27 May 2024 14:14:49 +0530 Subject: [PATCH] Push arm64 builds to ghcr. --- .github/workflows/cd.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..f750b0d --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,53 @@ +name: cd + +on: + push: + branches: master + +permissions: + contents: write + id-token: write + packages: write + +jobs: + container: + name: Build Docker image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install cosign + uses: sigstore/cosign-installer@v3.1.1 + with: + cosign-release: v2.1.1 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2.9.1 + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v2.2.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Get branch name + shell: bash + run: echo "##[set-output name=git_branch;]$(echo ${GITHUB_REF##*/})" + id: extract_branch + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v4.6.0 + with: + images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" + tags: | + type=raw,value=${{ steps.extract_branch.outputs.git_branch }} + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4.1.1 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: 'true' + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max=