-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (154 loc) · 3.91 KB
/
CI.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 9 * * 0'
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Prettier
run: npm run format:check
eslint:
name: ESLint
runs-on: ubuntu-latest
needs:
- prettier
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: ESLint
run: npm run lint:eslint
svelte-check:
name: Svelte Check
runs-on: ubuntu-latest
needs:
- prettier
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Svelte Check
run: npm run check:ci
build:
name: Build
runs-on: ubuntu-latest
needs:
- eslint
- svelte-check
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node lts/*
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: npm run build:ci
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build
path: .svelte-kit/cloudflare
codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript']
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
#deploy:
# name: Deploy to Cloudflare Pages
# runs-on: ubuntu-latest
# needs:
# - build
# - codeql
# timeout-minutes: 5
# permissions:
# contents: read
# pages: write
# id-token: write
# environment:
# name: Cloudflare Pages
# url: ${{ steps.deployment.outputs.url}}
# steps:
# - name: Download build artifact
# uses: actions/download-artifact@v3
# with:
# name: build
# path: .svelte-kit/cloudflare
# - name: Publish to Cloudflare Pages
# id: deployment
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.CLOUDFLARE_DEPLOYMENT_KEY }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# projectName: portfolio
# directory: .svelte-kit/cloudflare
# branch: ${{ github.ref_name}}
# # Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ github.token }}