Skip to content

Build and deploy code #35

Build and deploy code

Build and deploy code #35

Workflow file for this run

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