-
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (56 loc) · 1.51 KB
/
deploy-to-stg.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy to Staging (stg)
on:
push:
branches: [stg]
workflow_dispatch:
concurrency:
group: deploy-to-stg
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
environment: deploy-to-stg
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT_CHECKOUT }}
submodules: "recursive"
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "yarn"
- uses: actions/cache/restore@v4
with:
path: |
public
.cache
key: gatsby-v1-${{ hashFiles('public') }}
restore-keys: |
gatsby-v1-
- run: yarn install --immutable
- run: yarn build
env:
# "bucketName" is a required option for gatsby-plugin-s3
AWS_S3_BUCKET_NAME: "example"
ALL_PAGES_TO_NO_INDEX: "true"
GTM_ID: ${{ vars.GTM_ID }}
PREFIX_PATHS: "true"
GATSBY_SITE_URL: "https://bicstone.github.io/portfolio"
PATH_PREFIX: "/portfolio"
- run: |
echo -e "User-agent: *\nDisallow: /" > ./public/robots.txt
- uses: actions/upload-pages-artifact@v3
with:
path: ./public
- uses: actions/deploy-pages@v4
- uses: actions/cache/save@v4
with:
path: |
public
.cache
key: gatsby-v1-${{ hashFiles('public') }}