-
-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (48 loc) · 1.61 KB
/
ci.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
name: CI
on:
push:
repository_dispatch:
types: [trigger-ci-workflow]
env:
FORCE_COLOR: true
jobs:
build:
name: Build SPA
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Print GitHub event action
run: echo "${{ github.event.action }}"
- uses: actions/checkout@v4
if: ${{ github.event.action != 'repository_dispatch' }}
- uses: actions/checkout@v4
if: ${{ github.event.action == 'repository_dispatch' }}
with:
ref: ${{ github.event.client_payload.sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get Yarn Cache Directory
id: yarn-cache-dir-path
run: echo '::set-output name=dir::$(yarn cache dir)'
- name: Use Yarn Cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install --prefer-offline --frozen-lockfile
- name: Build SPA
run: yarn build:ci
- name: Deploy SPA
if: success() && ${{ github.ref == 'refs/heads/master' }}
uses: wopian/netlify-actions-colors-fix/cli@b336c456c5b67c3f95e06fc1221725a657d896d6
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=dist --prod --message='Deployed ${{ github.sha }} via GitHub Actions'