54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Deploy 1000h portal
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "1000h-portal/**"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "1000h-portal/**"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
name: Deploy
|
|
steps:
|
|
# checkout the code
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/cache@v4
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
with:
|
|
path: "**/node_modules"
|
|
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
|
|
|
- name: Setup node env
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "20"
|
|
|
|
# Debugging installation issues
|
|
- name: Show npm logs if install fails
|
|
if: failure()
|
|
run: cat /home/runner/.npm/_logs/* || true
|
|
|
|
- name: Install dependencies
|
|
run: yarn install
|
|
|
|
- name: Build
|
|
run: yarn portal:generate
|
|
|
|
- name: Deploy
|
|
uses: cloudflare/wrangler-action@v3
|
|
with:
|
|
apiToken: ${{ secrets.CF_BASEONE_API_TOKEN }}
|
|
preCommands: npm install @cloudflare/kv-asset-handler
|
|
accountId: ${{ secrets.CF_BASEONE_ACCOUNT_ID }}
|
|
command: deploy
|
|
workingDirectory: "1000h-portal"
|