From 71e7cca21f0b5012b4d66ff59c1a09181c01b8dd Mon Sep 17 00:00:00 2001 From: Julia Ogris Date: Thu, 6 Oct 2022 11:23:38 +1100 Subject: [PATCH 1/2] hermit: Upgrade firebase version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade firebase version in hope to unbreak CI. `make firebase-deploy` to dev channel also failed locally (randomly, it didn't do that before). With the update it doesn't so 🤞. --- bin/{.firebase-11.6.0.pkg => .firebase-11.13.0.pkg} | 0 bin/firebase | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename bin/{.firebase-11.6.0.pkg => .firebase-11.13.0.pkg} (100%) diff --git a/bin/.firebase-11.6.0.pkg b/bin/.firebase-11.13.0.pkg similarity index 100% rename from bin/.firebase-11.6.0.pkg rename to bin/.firebase-11.13.0.pkg diff --git a/bin/firebase b/bin/firebase index b758311a..00c2caae 120000 --- a/bin/firebase +++ b/bin/firebase @@ -1 +1 @@ -.firebase-11.6.0.pkg \ No newline at end of file +.firebase-11.13.0.pkg \ No newline at end of file From c9105d53002b69e01b2f8d3eb327d6ef27f00819 Mon Sep 17 00:00:00 2001 From: Julia Ogris Date: Thu, 6 Oct 2022 11:46:51 +1100 Subject: [PATCH 2/2] github: Replace firebase-deployment action Replace firebase-deployment action by hand-crafted make targets. This has been motivated by an apparently broken firebase-tools release (4 hours old) that cannot be down-graded when using the firebase GitHub action and is a blocker. Aside: the foxygoat authors believe it is nice to stay third-party GitHub action free where possible so that the bulk of what's run on CI can also be run locally. --- .github/workflows/cicd.yaml | 6 ++++++ .github/workflows/firebase-hosting-merge.yml | 17 ----------------- .../workflows/firebase-hosting-pull-request.yml | 15 --------------- Makefile | 5 +++-- 4 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/firebase-hosting-merge.yml delete mode 100644 .github/workflows/firebase-hosting-pull-request.yml diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index b54e024b..fb02431c 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -11,6 +11,9 @@ jobs: steps: - uses: actions/checkout@v2 - run: ./bin/make ci + - run: ./bin/make firebase-deploy + env: + FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_EVY_LANG }} release: runs-on: ubuntu-latest @@ -22,3 +25,6 @@ jobs: - run: ./bin/make release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./bin/make firebase-deploy-prod + env: + FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_EVY_LANG }} diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml deleted file mode 100644 index 02230b06..00000000 --- a/.github/workflows/firebase-hosting-merge.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Deploy to Firebase Hosting on merge -on: - push: - branches: [ master ] -jobs: - build_and_deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: ./bin/make firebase-public - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_EVY_LANG }}' - channelId: live - projectId: evy-lang - entryPoint: firebase diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml deleted file mode 100644 index f9add164..00000000 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Deploy to Firebase Hosting on PR -on: pull_request -jobs: - build_and_preview: - if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: ./bin/make firebase-public - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_EVY_LANG }}' - projectId: evy-lang - entryPoint: firebase diff --git a/Makefile b/Makefile index 27b08583..9517b1c2 100644 --- a/Makefile +++ b/Makefile @@ -86,12 +86,13 @@ frontend-serve: frontend ## Build frontend and serve on free port # --- firebase ----------------------------------------------------------------- CHANNEL ?= dev +AUTH_CI = $(if $(CI), { printenv FIREBASE_SERVICE_ACCOUNT > out/gac.json; export GOOGLE_APPLICATION_CREDENTIALS=out/gac.json; };) firebase-deploy-prod: firebase-public ## Deploy to live channel on firebase, use with care! - firebase --config firebase/firebase.json deploy + $(AUTH_CI) firebase --config firebase/firebase.json deploy firebase-deploy: firebase-public ## Deploy to dev (or other) channel on firebase - firebase --config firebase/firebase.json hosting:channel:deploy $(CHANNEL) + $(AUTH_CI) firebase --config firebase/firebase.json hosting:channel:deploy $(CHANNEL) firebase-emulate: firebase-public ## Run firebase emulator for auth, hosting and datastore firebase --config firebase/firebase.json emulators:start