-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding read me and commenting potential change to actions (#230)
* Adding a read me with super basic instructions * Only running the preview when there is a label requesting it * Only running preview when certain things change * Disabling this for now as it is not a quick win
- Loading branch information
1 parent
8c1c20e
commit 2cadcdc
Showing
2 changed files
with
92 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,76 @@ | ||
name: Deploy to Firebase Preview | ||
|
||
on: | ||
pull_request: | ||
pull_request: | ||
# We should look into not always running a preview for every PR | ||
# paths: | ||
# - .env | ||
# - .firebaserc | ||
# - .lighthouserc.js | ||
# - config.ts | ||
# - gatsby* | ||
# - package.json | ||
# - tsconfig.json | ||
# - types.d.tsconfig | ||
# - yarn.lock | ||
# - content/** | ||
# - patches/** | ||
# - plugins/** | ||
# - src/** | ||
# - static/** | ||
|
||
concurrency: | ||
group: preview-${{ github.ref }} | ||
group: preview-${{ github.ref }} | ||
|
||
jobs: | ||
build_and_preview: | ||
runs-on: ubuntu-2004-large | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 20 | ||
- name: Fetch base_ref HEAD to use it as Ancestor hash in LHCI | ||
run: git fetch --depth=1 origin +refs/heads/${{github.base_ref}}:refs/remotes/origin/${{github.base_ref}} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18.x' | ||
- name: Caching | ||
id: gatsby-cache-build | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
node_modules | ||
.cache | ||
public | ||
key: ${{ runner.os }}-gatsby-build-preview-${{github.head_ref}}-${{ github.run_id }} | ||
restore-keys: | | ||
${{ runner.os }}-gatsby-build-preview-${{github.head_ref}}- | ||
- run: yarn install | ||
- run: yarn run build --log-pages | ||
env: | ||
CI: true | ||
STRAPI_API_URL: ${{ secrets.STRAPI_API_URL }} | ||
STRAPI_TOKEN: ${{ secrets.STRAPI_TOKEN }} | ||
GATSBY_DB_USER: ${{ secrets.GATSBY_DB_USER }} | ||
GATSBY_DB_PASS: ${{ secrets.GATSBY_DB_PASS }} | ||
GATSBY_DB_HOST: ${{ secrets.GATSBY_DB_HOST }} | ||
GATSBY_DB_PORT: ${{ secrets.GATSBY_DB_PORT }} | ||
GATSBY_DB_NAME: ${{ secrets.GATSBY_DB_NAME }} | ||
- name: run Lighthouse CI | ||
run: | | ||
npm install -g @lhci/[email protected] | ||
lhci autorun | ||
env: | ||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | ||
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }} | ||
LHCI_BASIC_AUTH_USERNAME: ${{ secrets.LHCI_BASIC_AUTH_USERNAME }} | ||
LHCI_BASIC_AUTH_PASSWORD: ${{ secrets.LHCI_BASIC_AUTH_PASSWORD }} | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
id: firebase | ||
with: | ||
repoToken: "${{ secrets.GITHUB_TOKEN }}" | ||
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" | ||
expires: 30d | ||
projectId: estuary-marketing | ||
- run: echo ${{steps.firebase.outputs.urls}} | ||
build_and_preview: | ||
runs-on: ubuntu-2004-large | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 20 | ||
- name: Fetch base_ref HEAD to use it as Ancestor hash in LHCI | ||
run: git fetch --depth=1 origin +refs/heads/${{github.base_ref}}:refs/remotes/origin/${{github.base_ref}} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18.x' | ||
- name: Caching | ||
id: gatsby-cache-build | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
node_modules | ||
.cache | ||
public | ||
key: ${{ runner.os }}-gatsby-build-preview-${{github.head_ref}}-${{ github.run_id }} | ||
restore-keys: | | ||
${{ runner.os }}-gatsby-build-preview-${{github.head_ref}}- | ||
- run: yarn install | ||
- run: yarn run build --log-pages | ||
env: | ||
CI: true | ||
STRAPI_API_URL: ${{ secrets.STRAPI_API_URL }} | ||
STRAPI_TOKEN: ${{ secrets.STRAPI_TOKEN }} | ||
GATSBY_DB_USER: ${{ secrets.GATSBY_DB_USER }} | ||
GATSBY_DB_PASS: ${{ secrets.GATSBY_DB_PASS }} | ||
GATSBY_DB_HOST: ${{ secrets.GATSBY_DB_HOST }} | ||
GATSBY_DB_PORT: ${{ secrets.GATSBY_DB_PORT }} | ||
GATSBY_DB_NAME: ${{ secrets.GATSBY_DB_NAME }} | ||
- name: run Lighthouse CI | ||
run: | | ||
npm install -g @lhci/[email protected] | ||
lhci autorun | ||
env: | ||
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | ||
LHCI_TOKEN: ${{ secrets.LHCI_TOKEN }} | ||
LHCI_BASIC_AUTH_USERNAME: ${{ secrets.LHCI_BASIC_AUTH_USERNAME }} | ||
LHCI_BASIC_AUTH_PASSWORD: ${{ secrets.LHCI_BASIC_AUTH_PASSWORD }} | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
id: firebase | ||
with: | ||
repoToken: '${{ secrets.GITHUB_TOKEN }}' | ||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT }}' | ||
expires: 30d | ||
projectId: estuary-marketing | ||
- run: echo ${{steps.firebase.outputs.urls}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Marketing Site | ||
|
||
The marketing site at https://estuary.dev | ||
|
||
# How to install? | ||
|
||
Make sure Node and yarn are installed. | ||
|
||
Run: `yarn install` | ||
|
||
## Troubleshooting | ||
|
||
### I am seeing old UI content | ||
|
||
Run: `yarn clean` | ||
|
||
This will clear out the cache that is populated during build. This will mean your next `start` will take extra time. | ||
|
||
# How to start/run? | ||
|
||
Run: `yarn start` | ||
|
||
# Stuff we use |