44 lines (38 loc) · 970 Bytes
/
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
name: Deploy
on:
push:
branches:
- main
# Add a schedule to run the job every day at 0:00 UTC
schedule:
- cron: "0 0 * * *"
# Allow running this workflow manually.
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: npm
cache-dependency-path: cors-proxy/package-lock.json
- name: Install dependencies
working-directory: ./cors-proxy
run: |
npm install
- name: Run linter
working-directory: ./cors-proxy
run: |
npx prettier --check .
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Publish
uses: cloudflare/wrangler-action@v3.5.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: "cors-proxy"