Skip to content

Commit

Permalink
ci: add workflows for v3 beta publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Jan 31, 2024
1 parent 058c612 commit 2f67611
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/web.beta.publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Publish @notesnook/web Beta

on:
on:
workflow_dispatch:
push:
branches:
- master
branches-ignore:
- v3-beta
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
Expand All @@ -22,6 +24,8 @@ on:
- synchronize
branches:
- master
branches-ignore:
- v3-beta
paths-ignore:
- "apps/mobile/**"
- "packages/editor-mobile/**"
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/web.v3-beta.publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish @notesnook/web v3 Beta

on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: ./.github/actions/setup-node-with-cache

- name: Install packages
run: |
npm ci --ignore-scripts --prefer-offline --no-audit
npm run bootstrap -- --scope=web
- name: Setup environment
run: |
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
- name: Generate beta build
run: npm run build:beta:web

- name: Publish to Cloudflare Pages
uses: unlike-ltd/github-actions-cloudflare-pages@v0.1.1
id: pages
with:
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
cloudflare-project-name: notesnook-v3-app
directory: ./apps/web/build
github-token: ${{ secrets.GITHUB_TOKEN }}
github-environment: ${{ (github.ref == 'refs/heads/master' && 'beta') || 'preview' }}

0 comments on commit 2f67611

Please sign in to comment.