-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.62 KB
/
ci.yml
File metadata and controls
64 lines (55 loc) · 1.62 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
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
actions: write
contents: read
pull-requests: write
jobs:
main:
runs-on: ubuntu-latest
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Set up Node.js with caching for npm dependencies
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
# Restore the cached .nx folder (if it exists)
- name: Restore Nx cache
id: nx-cache
uses: actions/cache@v3
with:
path: .nx
key: nx-cache-${{ runner.os }}-${{ hashFiles('**/nx.json') }}
restore-keys: |
nx-cache-${{ runner.os }}-
# Install dependencies
- name: Install dependencies
run: npm ci
# Set commit shas for Nx if needed
- name: Set Nx SHAs
uses: nrwl/nx-set-shas@v4
# Run Nx tasks including the staging deployment and extract the URL.
- name: Run Nx tasks including staging deployment
id: checks
run: npx nx affected -t lint test:ci type-check build # deploy:staging
- name: Cache Nx folder
uses: actions/cache@v3
with:
path: .nx
key: nx-cache-${{ runner.os }}-${{ hashFiles('**/nx.json') }}
restore-keys: |
nx-cache-${{ runner.os }}-