Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable preview environment #265

Merged
merged 11 commits into from
Dec 10, 2023
Prev Previous commit
Next Next commit
Remove preview env deployment from CI, and restore CI steps
eloisetaylor5693 committed Dec 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6d7bbe149d9873de0762a3d0392f9557828f2a41
71 changes: 21 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -10,54 +10,22 @@ on:
branches: [main]

jobs:
# build:
# runs-on: ubuntu-latest

# strategy:
# matrix:
# node-version: [18.x, 20.x, 21.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# fail-fast: false

# steps:
# - uses: actions/checkout@v2

# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}
# cache: "yarn"

# - run: yarn install --immutable --immutable-cache

# - run: yarn build
# env:
# CONTENTFUL_SPACE_ID: "${{ secrets.CONTENTFUL_SPACE_ID }}"
# CONTENTFUL_DELIVERY_TOKEN: "${{ secrets.CONTENTFUL_DELIVERY_TOKEN }}"

# # - run: cat public/webpack.stats.json
# # #if: false # disabling whilst there are issues with BundleStats
build:
runs-on: ubuntu-latest

# # - name: BundleStats
# # #if: false # disabling whilst there are issues with BundleStats
# # # You may pin to the exact commit or the version.
# # # uses: vio/bundle-stats-action@6a98706a7aefa0fe25da5a1f48fa46e7b23bd653
# # uses: vio/bundle-stats-action@v1
# # with:
# # id: friends-of-foxley-app
# # webpack-stats-path: public/webpack.stats.json
# # repo-token: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
fail-fast: false

deploy_preview_api:
name: Build and deploy to Preview API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install node
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
node-version: ${{ matrix.node-version }}
cache: "yarn"

- run: yarn install --immutable --immutable-cache
@@ -66,13 +34,16 @@ jobs:
env:
CONTENTFUL_SPACE_ID: "${{ secrets.CONTENTFUL_SPACE_ID }}"
CONTENTFUL_DELIVERY_TOKEN: "${{ secrets.CONTENTFUL_DELIVERY_TOKEN }}"
CONTENTFUL_HOST: "preview.contentful.com"
CONTENTFUL_PREVIEW_ACCESS_TOKEN: "${{ secrets.CONTENTFUL_PREVIEW_ACCESS_TOKEN }}"

- name: Deploy to preview site
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FRIENDS_OF_FOXLEY_PROD }}"
channelId: friends-of-foxley-preview
projectId: friends-of-foxley-prod
# - run: cat public/webpack.stats.json
# #if: false # disabling whilst there are issues with BundleStats

# - name: BundleStats
# #if: false # disabling whilst there are issues with BundleStats
# # You may pin to the exact commit or the version.
# # uses: vio/bundle-stats-action@6a98706a7aefa0fe25da5a1f48fa46e7b23bd653
# uses: vio/bundle-stats-action@v1
# with:
# id: friends-of-foxley-app
# webpack-stats-path: public/webpack.stats.json
# repo-token: ${{ secrets.GITHUB_TOKEN }}