-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.29 KB
/
build.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
45
46
name: Build and deploy code
on:
release:
types: [published]
workflow_dispatch:
schedule:
- cron: '41 6 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb
- uses: actions/setup-node@v4
with:
node-version: 20
- name: lint
run: |
npm i
npm run lint
echo ${{github.ref}}
echo ${{contains(github.ref, 'refs/tags/v')}}
- name: build
run: npm run build
- name: Deploy prod
if: ${{contains(github.ref, 'refs/tags/v')}}
uses: ryand56/[email protected]
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: dist
destination-dir: sdks/ads
- name: Deploy dev
if: github.ref == 'refs/heads/main'
uses: ryand56/[email protected]
with:
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: dist
destination-dir: sdks/dev/ads