2021-02-06 02:38:26 +09:00
|
|
|
name: Build and Deploy
|
2021-02-05 16:22:07 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
2021-02-06 02:38:26 +09:00
|
|
|
build:
|
2021-02-06 02:33:50 +09:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: '12.x'
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-node-
|
|
|
|
|
|
|
|
- name: install
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
run: yarn build
|
|
|
|
|
|
|
|
- name: export
|
|
|
|
run: yarn export
|
|
|
|
|
|
|
|
- name: add nojekyll
|
|
|
|
run: touch ./out/.nojekyll
|
|
|
|
|
2021-02-06 02:38:26 +09:00
|
|
|
deploy:
|
2021-02-05 16:22:07 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Publish
|
|
|
|
uses: cloudflare/wrangler-action@1.3.0
|
|
|
|
env:
|
|
|
|
USER: root
|
|
|
|
with:
|
|
|
|
apiToken: ${{ secrets.CF_API_TOKEN }}
|
2021-02-06 02:36:15 +09:00
|
|
|
workingDirectory: './out'
|