From 64ce0582f9e79d904f458ba807f9b70d03c16703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20G=C3=A9rard?= Date: Wed, 22 May 2024 17:25:32 +0200 Subject: [PATCH 1/3] build: use GitHub environments --- .github/workflows/firebase-preview-deployment.yaml | 4 ++++ .github/workflows/firebase-production-deployment.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/firebase-preview-deployment.yaml b/.github/workflows/firebase-preview-deployment.yaml index ed11000..e13dcb5 100644 --- a/.github/workflows/firebase-preview-deployment.yaml +++ b/.github/workflows/firebase-preview-deployment.yaml @@ -12,6 +12,9 @@ jobs: build_and_preview: if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest + environment: + name: preview + url: ${{ steps.deploy.outputs.details_url }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -20,6 +23,7 @@ jobs: cache: "npm" - run: npm ci && npx ng version && npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 + id: deploy with: repoToken: ${{ secrets.GITHUB_TOKEN }} firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_HELLO_WORLD_F3218 }} diff --git a/.github/workflows/firebase-production-deployment.yaml b/.github/workflows/firebase-production-deployment.yaml index 34abb51..82bcfe4 100644 --- a/.github/workflows/firebase-production-deployment.yaml +++ b/.github/workflows/firebase-production-deployment.yaml @@ -10,6 +10,9 @@ on: jobs: build_and_deploy: runs-on: ubuntu-latest + environment: + name: production + url: ${{ steps.deploy.outputs.details_url }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -18,6 +21,7 @@ jobs: cache: "npm" - run: npm ci && npx ng version && npm run build - uses: FirebaseExtended/action-hosting-deploy@v0 + id: deploy with: repoToken: ${{ secrets.GITHUB_TOKEN }} firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_HELLO_WORLD_F3218 }} From a4362752b1c9953d11d0e88f0ea9e9b3744f19a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20G=C3=A9rard?= Date: Wed, 22 May 2024 17:28:59 +0200 Subject: [PATCH 2/3] refactor: rename workflows --- .github/workflows/firebase-preview-deployment.yaml | 2 +- .github/workflows/firebase-production-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/firebase-preview-deployment.yaml b/.github/workflows/firebase-preview-deployment.yaml index e13dcb5..1003e6d 100644 --- a/.github/workflows/firebase-preview-deployment.yaml +++ b/.github/workflows/firebase-preview-deployment.yaml @@ -2,7 +2,7 @@ # Firebase CLI repository: https://github.com/firebase/firebase-tools # Command: firebase init hosting -name: Deploy to Firebase Hosting on PR +name: Firebase Hosting preview deployment on: pull_request permissions: checks: write diff --git a/.github/workflows/firebase-production-deployment.yaml b/.github/workflows/firebase-production-deployment.yaml index 82bcfe4..67fb1ee 100644 --- a/.github/workflows/firebase-production-deployment.yaml +++ b/.github/workflows/firebase-production-deployment.yaml @@ -2,7 +2,7 @@ # Firebase CLI repository: https://github.com/firebase/firebase-tools # Command: firebase init hosting -name: Deploy to Firebase Hosting on merge +name: Firebase Hosting production deployment on: push: branches: From 6db41abfe440b18366523027181645b17800111e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20G=C3=A9rard?= Date: Wed, 22 May 2024 17:53:39 +0200 Subject: [PATCH 3/3] ci: update production deployment workflow trigger event --- .github/workflows/firebase-production-deployment.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/firebase-production-deployment.yaml b/.github/workflows/firebase-production-deployment.yaml index 67fb1ee..15b14ff 100644 --- a/.github/workflows/firebase-production-deployment.yaml +++ b/.github/workflows/firebase-production-deployment.yaml @@ -4,9 +4,8 @@ name: Firebase Hosting production deployment on: - push: - branches: - - main + release: + types: [released] jobs: build_and_deploy: runs-on: ubuntu-latest