ci(web): 💚 test ci build #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- apps/sso/**/* | |
- apps/website/**/* | |
workflow_dispatch: | |
jobs: | |
deploy: | |
# prevents this action from running on forks | |
if: github.repository == 'willin/sso' | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 1 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- run: bun install | |
- run: bun run build | |
- name: migrate D1 database | |
uses: cloudflare/[email protected] | |
with: | |
command: d1 --config apps/sso/wrangler.toml migrations apply sso | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
- name: Deploy API Service | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
command: deploy --config wrangler.toml | |
workingDirectory: apps/sso | |
# secrets: | | |
# AFDIAN_CLIENT_ID | |
# AFDIAN_CLIENT_SECRET | |
# AFDIAN_CALLBACK_URL | |
# ALIPAY_APP_ID | |
# ALIPAY_PRIVATE_KEY | |
# ALIPAY_CALLBACK_URL | |
# GITHUB_ID | |
# GITHUB_SECRET | |
# SESSION_SECRET | |
# SESSION_KEY | |
# GITHUB_CALLBACK_URL | |
# env: | |
# CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} | |
# AFDIAN_CLIENT_ID: ${{ secrets.AFDIAN_CLIENT_ID }} | |
# AFDIAN_CLIENT_SECRET: ${{ secrets.AFDIAN_CLIENT_SECRET }} | |
# AFDIAN_CALLBACK_URL: ${{ secrets.AFDIAN_CALLBACK_URL }} | |
# ALIPAY_APP_ID: ${{ secrets.ALIPAY_APP_ID }} | |
# ALIPAY_PRIVATE_KEY: ${{ secrets.ALIPAY_PRIVATE_KEY }} | |
# ALIPAY_CALLBACK_URL: ${{ secrets.ALIPAY_CALLBACK_URL }} | |
# GITHUB_ID: ${{ secrets.GH_CLIENT_ID }} | |
# GITHUB_SECRET: ${{ secrets.GH_CLIENT_SECRET }} | |
# SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
# SESSION_KEY: ${{ secrets.SESSION_KEY }} | |
# GITHUB_CALLBACK_URL: ${{ secrets.GITHUB_CALLBACK_URL }} | |
- name: Deploy Website | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
apiToken: ${{ secrets.CF_API_TOKEN }} | |
command: deploy --config apps/website/wrangler.toml | |
env: | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} |