Skip to content

Commit

Permalink
Add CD for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
toririm committed Feb 1, 2025
1 parent b6d1ac5 commit 7792279
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/mobile-cloudflare-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: mobile / deploy

on:
push:
branches:
- main
paths:
- "services/mobile/**"
- "modules/common/**"
- ".github/workflows/mobile-cloudflare-merge.yml"

defaults:
run:
working-directory: services/mobile

permissions:
contents: read
deployments: write

jobs:
build_and_deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run build
env:
VITE_SOHOSAI_VOTE_URL: ${{ secrets.VITE_SOHOSAI_VOTE_URL }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cafeore-2024
directory: build/client
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
# branch: main
# Optional: Change the working directory
workingDirectory: services/mobile
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: '3'
43 changes: 43 additions & 0 deletions .github/workflows/mobile-cloudflare-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: mobile / preview

on:
pull_request:
paths:
- "services/mobile/**"
- "modules/common/**"
- ".github/workflows/mobile-cloudflare-preview.yml"

defaults:
run:
working-directory: services/mobile

permissions:
contents: read
deployments: write

jobs:
build_and_deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: './.github/actions/setup-deps'
- run: pnpm run build
env:
VITE_SOHOSAI_VOTE_URL: ${{ secrets.VITE_SOHOSAI_VOTE_URL }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cafeore-2024
directory: build/client
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# Optional: Switch what branch you are publishing to.
# By default this will be the branch which triggered this workflow
# branch: main
# Optional: Change the working directory
workingDirectory: services/mobile
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
wranglerVersion: '3'

0 comments on commit 7792279

Please sign in to comment.