63 lines
1.2 KiB
YAML
63 lines
1.2 KiB
YAML
name: Build and Deploy Web
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths:
|
|
- web/**
|
|
- ./bootstrap.sh
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./web
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache: 'npm'
|
|
cache-dependency-path: 'web/package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: build
|
|
env:
|
|
BASE_PATH: ''
|
|
run: |
|
|
npm run build
|
|
touch build/.nojekyll
|
|
cp ../bootstrap.sh build/bootstrap.sh
|
|
echo "shokku.dev" > build/CNAME
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v1
|
|
with:
|
|
path: ./web/build
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- uses: actions/deploy-pages@v1
|
|
id: deployment
|