mirror of https://github.com/yewstack/yew
67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
name: Build website
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
paths:
|
|
- "website/**"
|
|
- "firebase.json"
|
|
- ".github/workflows/*-website.yml"
|
|
push:
|
|
branches: [master]
|
|
paths:
|
|
- "website/**"
|
|
- "firebase.json"
|
|
- ".github/workflows/*-website.yml"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Website
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "18"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd website
|
|
npm install
|
|
|
|
- name: Run prettier
|
|
run: |
|
|
cd website
|
|
npm run fmt
|
|
|
|
- name: Check Translations
|
|
run: |
|
|
cd website
|
|
npm run check-translations
|
|
|
|
- name: Build
|
|
run: |
|
|
cd website
|
|
npm run build
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: website
|
|
path: website/build/
|
|
retention-days: 1
|
|
|
|
- if: github.event_name == 'pull_request'
|
|
name: Build pr info
|
|
run: |
|
|
echo "${{ github.event.number }}" > .PR_INFO
|
|
|
|
- if: github.event_name == 'pull_request'
|
|
name: Upload pr info
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: pr-info
|
|
path: .PR_INFO
|
|
retention-days: 1
|