From 02e0bd1cc88bde29c947ebe3d169faf4e15dd7d7 Mon Sep 17 00:00:00 2001 From: kbellouard Date: Tue, 8 Jul 2025 11:32:55 +0200 Subject: [PATCH] feat: deployment --- .github/workflows/deploy.yml | 46 +++++++++++++++++++++++++++++++++ .github/workflows/frontcicd.yml | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..29d747e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deployment pipeline + +on: + push: + branches: + - main + +env: + REGISTRY: ghcr.io + IMAGE_NAME: sanalyz-front + +jobs: + build-and-push-images: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v2 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/.github/workflows/frontcicd.yml b/.github/workflows/frontcicd.yml index 970e15d..226b16d 100644 --- a/.github/workflows/frontcicd.yml +++ b/.github/workflows/frontcicd.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '21' + node-version: "21" - name: Install dependencies run: npm install