Skip to content

Commit 57f2b7e

Browse files
committed
feat: use fastly for pr deploys
1 parent 5ef92dc commit 57f2b7e

File tree

2 files changed

+81
-1
lines changed

2 files changed

+81
-1
lines changed

.github/workflows/development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
# -------------------------------------------------------------
203203
publish_site:
204204
name: Publish
205-
uses: ./.github/workflows/publish-site.yml
205+
uses: ./.github/workflows/publish-site-fastly.yml
206206
with:
207207
deploy-message: ${{ github.event.pull_request.title }}
208208
alias: pr-${{ github.event.number }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish documentation
2+
#
3+
# This workflow publishes the documentation to Fastly
4+
#
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
deploy-message:
10+
required: false
11+
type: string
12+
alias:
13+
required: false
14+
type: string
15+
workflow_call:
16+
inputs:
17+
deploy-message:
18+
required: false
19+
type: string
20+
alias:
21+
required: false
22+
type: string
23+
24+
permissions:
25+
contents: read
26+
pull-requests: write
27+
28+
jobs:
29+
publish_site:
30+
name: Publish to Fastly
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
steps:
34+
## --- SETUP --- ##
35+
- name: Check out code
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Use Node LTS version
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
cache: yarn
45+
46+
- name: Enable Corepack
47+
run: corepack enable
48+
49+
## --- YARN CACHE --- ##
50+
- name: Check for cached dependencies
51+
continue-on-error: true
52+
id: cache-dependencies
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
.cache/yarn
57+
node_modules
58+
key: ubuntu-latest-node20-${{ hashFiles('yarn.lock') }}
59+
60+
## --- INSTALL --- ##
61+
# note: if cache-hit isn't needed b/c yarn will leverage the cache if it exists
62+
- name: Install dependencies
63+
shell: bash
64+
run: yarn install --immutable
65+
66+
## --- BUILD --- ##
67+
- name: Build storybook
68+
shell: bash
69+
run: yarn build:docs
70+
71+
## --- DEPLOY WEBSITE TO Fastly --- ##
72+
- name: Deploy to Fastly
73+
uses: fastly/compute-actions/preview@v11
74+
with:
75+
fastly-api-token: ${{ secrets.FASTLY_API_KEY }}
76+
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
service_id: ZRzI0ci9myQCiR14oxEmC7
78+
comment: ${{ inputs.deploy-message }}
79+
alias: ${{ inputs.alias }}
80+
timeout-minutes: 10

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy