fix local dev #7
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: Verify and Publish | |
on: | |
workflow_dispatch: | |
push: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
verify: | |
name: Verify | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
shell: bash | |
run: npm ci | |
- name: ESLint | |
shell: bash | |
run: npm run lint-eslint | |
- name: Prettier | |
shell: bash | |
run: npm run lint-prettier | |
- name: Depcheck | |
shell: bash | |
run: npm run lint-depcheck | |
- name: Build | |
shell: bash | |
run: npm run build | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
shell: bash | |
run: npm ci | |
- name: Build | |
shell: bash | |
run: | | |
npm run build | |
cp package.json package-lock.json public | |
cd public | |
rm -rf node_modules | |
npm ci --omit dev | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: public | |
- name: Deploy to GitHub Pages | |
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' | |
uses: actions/deploy-pages@v4 |