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 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