-
-
Notifications
You must be signed in to change notification settings - Fork 671
59 lines (48 loc) · 1.72 KB
/
Copy pathbuild.yml
File metadata and controls
59 lines (48 loc) · 1.72 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
name: CI - Indexer job (deploy if master branch)
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- if: github.ref != 'refs/heads/master' || github.repository_owner != 'betaflight'
name: Run the checker script
run: ./scripts/build.sh
- if: github.ref == 'refs/heads/master' && github.repository_owner == 'betaflight'
name: Run the checker, indexer and deployment script
run: ./scripts/build.sh deploy
- if: github.ref == 'refs/heads/master' && github.repository_owner == 'betaflight'
name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: dist-files
path: public
retention-days: 7
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.repository_owner == 'betaflight'
steps:
- name: Download build artifact
uses: actions/download-artifact@v5
with:
name: dist-files
path: public
- name: Set alias branch name for Cloudflare (if a push)
id: branch_push
run: |
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Deploy to Cloudflare
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy public --project-name=${{ vars.CLOUDFLARE_PROJECT_NAME }} --branch=${{ env.BRANCH }} --commit-dirty=true