File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+ on :
3+ push :
4+ branches : [main]
5+ pull_request :
6+ branches : [main]
7+
8+ jobs :
9+ test :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ - uses : actions/setup-node@v4
14+ with :
15+ node-version : 20
16+ - run : npm ci
17+ - run : npm test
18+
19+ deploy :
20+ if : github.ref == 'refs/heads/main'
21+ needs : [test]
22+ runs-on : ubuntu-latest
23+ steps :
24+ - uses : actions/checkout@v4
25+ - name : Deploy
26+ uses : cloudflare/wrangler-action@v3
27+ with :
28+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
29+ preCommands : |
30+ cp wranger.toml.example wrangler.toml
31+ echo "[env.production.vars]" >> wrangler.toml
32+ echo "REQUEST_URL = '${{ env.REQUEST_URL }}'" >> wrangler.toml
33+ echo "INFLUX_URL = '${{ env.INFLUX_URL }}'" >> wrangler.toml
34+ echo "INFLUX_METRIC_NAME = '${{ env.INFLUX_METRIC_NAME }}'" >> wrangler.toml
35+ echo "INFLUX_DATABASE = '${{ env.INFLUX_DATABASE }}'" >> wrangler.toml
36+ postCommands : |
37+ rm -f wrangler.toml
38+ environment : production
39+ secrets : |
40+ INFLUX_TOKEN
41+ env :
42+ REQUEST_URL : ${{ env.REQUEST_URL }}
43+ INFLUX_METRIC_NAME : ${{ env.INFLUX_METRIC }}
44+ INFLUX_URL : ${{ env.INFLUX_URL }}
45+ INFLUX_TOKEN : ${{ secrets.INFLUX_TOKEN }}
46+ INFLUX_DATABASE : ${{ env.INFLUX_DATABASE }}
You can’t perform that action at this time.
0 commit comments