Update deploy.yml #13
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 to Cloudflare | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
worker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
# For some reason, the default registry MAY FAIL WITH ECONNRESET on GitHub Actions | |
- name: Setup Registry | |
continue-on-error: true | |
run: | | |
cd worker | |
npm install --registry https://registry.npm.taobao.org | |
npm install [email protected] --registry https://registry.npm.taobao.org | |
- name: Log | |
run: | | |
cat `find /home/runner/.npm/_logs/` | |
- name: Deploy Workers | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.API_TOKEN }} | |
command: deploy | |
workingDirectory: worker | |
page: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
# For some reason, the default registry MAY FAIL WITH ECONNRESET on GitHub Actions | |
- name: Setup Registry | |
run: | | |
npm install --registry https://registry.npm.taobao.org | |
npm install [email protected] --registry https://registry.npm.taobao.org | |
- name: Deploy Pages | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.API_TOKEN }} | |
preCommands: | | |
npx @cloudflare/next-on-pages | |
command: pages deploy .vercel/output/static |