Skip to content

DO NOT MERGE // infra: migrate from netlify to fastly #3645

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
# -------------------------------------------------------------
publish_site:
name: Publish
uses: ./.github/workflows/publish-site.yml
uses: ./.github/workflows/publish-site-fastly.yml
with:
deploy-message: ${{ github.event.pull_request.title }}
alias: pr-${{ github.event.number }}
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/publish-site-fastly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Publish documentation
#
# This workflow publishes the documentation to Fastly
#

on:
workflow_dispatch:
inputs:
deploy-message:
required: false
type: string
alias:
required: false
type: string
workflow_call:
inputs:
deploy-message:
required: false
type: string
alias:
required: false
type: string

permissions:
contents: read
pull-requests: write

jobs:
publish_site:
name: Publish to Fastly
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
## --- SETUP --- ##
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node LTS version
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Enable Corepack
run: corepack enable

## --- YARN CACHE --- ##
- name: Check for cached dependencies
continue-on-error: true
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
.cache/yarn
node_modules
key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }}

## --- INSTALL --- ##
# note: if cache-hit isn't needed b/c yarn will leverage the cache if it exists
- name: Install dependencies
shell: bash
run: yarn install --immutable

## --- BUILD --- ##
- name: Build storybook
shell: bash
run: yarn build:docs

- name: Set up Fastly CLI
uses: fastly/compute-actions/setup@v11
with:
token: ${{ secrets.GITHUB_TOKEN }}

## --- DEPLOY WEBSITE TO Fastly --- ##
- name: Deploy to Fastly
uses: fastly/compute-actions/preview@v11
with:
fastly-api-token: ${{ secrets.FASTLY_API_KEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
project_directory: dist
timeout-minutes: 10
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ chromatic.config.json
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Fastly generated builds
compute-js/
Loading