From a830ff259eb369f325a32b183576fb7db817b1f2 Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Mon, 3 Jan 2022 23:32:57 +0700 Subject: [PATCH 1/5] firebase-hosting preview deploys --- .github/workflows/deploy-preview.yml | 21 +++++++++++++++++++++ firebase.json | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 00000000..923b378c --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,21 @@ +name: Deploy to Preview Channel + +on: + pull_request: + # Optionally configure to run only for specific files. For example: + # paths: + # - "website/**" + +jobs: + build_and_preview: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Add any build steps here. For example: + # - run: npm ci && npm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" + expires: 30d + projectId: tryrowy diff --git a/firebase.json b/firebase.json index a72a4d28..cfbc74ce 100644 --- a/firebase.json +++ b/firebase.json @@ -1,6 +1,5 @@ { "hosting": { - "target": "rowy", "public": "build", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ From 103f200ac71cbaea9dfa864805c29d0f4cd744ea Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 4 Jan 2022 00:23:53 +0700 Subject: [PATCH 2/5] fix secret name --- .github/workflows/deploy-preview.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 923b378c..8fe507f4 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -16,6 +16,7 @@ jobs: - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" + firebaseServiceAccount: + "${{ secrets.FIREBASE_SERVICE_ACCOUNT_TRYROWY }}" expires: 30d projectId: tryrowy From 7f7c6c0db086d86e80dda73d089ca7bd309d914d Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 4 Jan 2022 00:31:10 +0700 Subject: [PATCH 3/5] update preview config --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 8fe507f4..f78d6306 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -18,5 +18,5 @@ jobs: repoToken: "${{ secrets.GITHUB_TOKEN }}" firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_TRYROWY }}" - expires: 30d + expires: 14d projectId: tryrowy From afd99418cc3ef69827583e4ff349271784dfc0cb Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 4 Jan 2022 13:21:39 +0700 Subject: [PATCH 4/5] github action add build step --- .github/workflows/deploy-preview.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index f78d6306..06c1ad82 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -5,14 +5,21 @@ on: # Optionally configure to run only for specific files. For example: # paths: # - "website/**" - +env: + REACT_APP_FIREBASE_PROJECT_ID: tryrowy + REACT_APP_FIREBASE_PROJECT_WEB_API_KEY: + "${{ secrets.FIREBASE_WEB_API_KEY_TRYROWY }}" jobs: build_and_preview: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - # Add any build steps here. For example: - # - run: npm ci && npm run build + - uses: borales/actions-yarn@v2.3.0 + with: + cmd: install # will run `yarn install` command + - uses: borales/actions-yarn@v2.3.0 + with: + cmd: build # will run `yarn build` command - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" From ed18442ded5b39590aa5d808748c7828d2a93ea2 Mon Sep 17 00:00:00 2001 From: shamsmosowi Date: Tue, 4 Jan 2022 13:42:00 +0700 Subject: [PATCH 5/5] set CI for github action --- .github/workflows/deploy-preview.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 06c1ad82..311b205d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -9,6 +9,7 @@ env: REACT_APP_FIREBASE_PROJECT_ID: tryrowy REACT_APP_FIREBASE_PROJECT_WEB_API_KEY: "${{ secrets.FIREBASE_WEB_API_KEY_TRYROWY }}" + CI: "" jobs: build_and_preview: runs-on: ubuntu-latest @@ -20,6 +21,8 @@ jobs: - uses: borales/actions-yarn@v2.3.0 with: cmd: build # will run `yarn build` command + env: + CI: "" - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}"