From 114f909bb202cb6f9ecd07e5db3c9aac0a94c0b9 Mon Sep 17 00:00:00 2001 From: Xevion Date: Fri, 13 May 2022 04:24:06 -0500 Subject: [PATCH] Inject environment variables with GitHub Actions & Secrets, move relevant packages back into devDependencies --- .github/workflows/firebase-hosting-merge.yml | 5 +++++ .../workflows/firebase-hosting-pull-request.yml | 10 +++++++++- package.json | 16 ++++++++-------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 731f8d4..a233243 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -3,6 +3,11 @@ name: Deploy to Firebase Hosting on merge push: branches: - master + +env: + VUE_APP_ALGOLIA_APP_ID: '${{ secrets.ALGOLIA_APP_ID }}' + VUE_APP_ALGOLIA_API_KEY: '${{ secrets.ALGOLIA_API_KEY }}' + jobs: build_and_deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index 37bb062..2d5896b 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -1,12 +1,20 @@ name: Deploy to Firebase Hosting on PR 'on': pull_request + +env: + VUE_APP_ALGOLIA_APP_ID: '${{ secrets.ALGOLIA_APP_ID }}' + VUE_APP_ALGOLIA_API_KEY: '${{ secrets.ALGOLIA_API_KEY }}' + jobs: build_and_preview: if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@master + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: yarn install - run: yarn run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/package.json b/package.json index ef51955..b6c8532 100644 --- a/package.json +++ b/package.json @@ -33,19 +33,19 @@ "@vue/cli-plugin-babel": "^4.4.0", "@vue/cli-plugin-eslint": "^4.4.0", "@vue/cli-service": "^4.4.0", - "@vue/eslint-config-airbnb": "^5.0.2", - "@vue/eslint-config-prettier": "^6.0.0", - "babel-eslint": "^10.1.0", - "eslint": "^6.7.2", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-vue": "^6.2.2", - "prettier": "^2.1.1", "sass": "^1.26.5", "sass-loader": "^8.0.2", "vue-template-compiler": "^2.6.11" }, "devDependencies": { + "babel-eslint": "^10.1.0", + "eslint": "^6.7.2", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-prettier": "^3.1.4", + "eslint-plugin-vue": "^6.2.2", + "@vue/eslint-config-airbnb": "^5.0.2", + "@vue/eslint-config-prettier": "^6.0.0", + "prettier": "^2.1.1" }, "eslintConfig": { "root": true,