From c5b8c67d064753fe27be8f1deebe5a044b15f5d6 Mon Sep 17 00:00:00 2001 From: Yazeed AlKhalaf Date: Wed, 16 Oct 2024 18:47:16 +0300 Subject: [PATCH] add build and push falak workflow :D --- .github/workflows/build-push-falak.yaml | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-push-falak.yaml diff --git a/.github/workflows/build-push-falak.yaml b/.github/workflows/build-push-falak.yaml new file mode 100644 index 0000000..7eabc42 --- /dev/null +++ b/.github/workflows/build-push-falak.yaml @@ -0,0 +1,50 @@ +name: Build and Push Falak Image + +on: + push: + branches: [ main ] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }}/falak + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3.3.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.1 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push + id: push + uses: docker/build-push-action@v6.4 + with: + context: ./falak + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1.4.3 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true