-
Notifications
You must be signed in to change notification settings - Fork 31
74 lines (61 loc) · 2.1 KB
/
deploy-production.yml
File metadata and controls
74 lines (61 loc) · 2.1 KB
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
70
71
72
73
74
name: Deploy Production Storybook
on:
push:
branches:
- main
env:
NODE_OPTIONS: '--max_old_space_size=8196'
NX_CLOUD: false
IGNORE_COMMIT_MESSAGE: 'chore(release): publish'
permissions:
id-token: write
contents: write
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- name: Skip build from automated commit
uses: ./.github/actions/skip-automated-commits
with:
ignore-commit-message: ${{ env.IGNORE_COMMIT_MESSAGE }}
- name: Setup and Build
uses: ./.github/actions/yarn
- name: Cache Nx
uses: actions/cache@v4
with:
path: node_modules/.cache/nx
key: nx-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
nx-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.ref_name }}-
nx-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-
nx-${{ runner.os }}-
- name: Cache webpack
uses: actions/cache@v4
with:
path: |
node_modules/.cache
packages/styleguide/node_modules/.cache
key: webpack-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
webpack-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ github.ref_name }}-
webpack-${{ runner.os }}-${{ hashFiles('yarn.lock') }}-
- name: Set git user
uses: ./.github/actions/set-git-user
- name: Build All Packages
run: yarn build
- name: Build Storybook
run: yarn nx run styleguide:build-storybook
- name: Deploy to GitHub Pages
run: |
git remote set-url origin https://${{ secrets.ACTIONS_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
yarn deploy
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}