mirror of https://github.com/FOME-Tech/wiki.git
Add Preview workflow that works with forks (#138)
This commit is contained in:
parent
04a6a7f50d
commit
75d48d246a
|
@ -0,0 +1,38 @@
|
|||
# Build preview to Cloudflare Pages
|
||||
name: Build preview
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-preview
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'FOME-Tech' && github.actor != 'dependabot[bot]'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Save PR number
|
||||
run: |
|
||||
echo ${{ github.event.number }} > ./build/PR_NR
|
||||
|
||||
- name: Upload preview build
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build
|
||||
path: build/
|
|
@ -1,23 +0,0 @@
|
|||
# Validate build to provide early feedback on pull requests
|
||||
name: Build
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-build
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "npm"
|
||||
- run: npm ci
|
||||
- run: npm run build
|
|
@ -12,7 +12,7 @@
|
|||
"lint:fix:unsafe": "biome check . --apply-unsafe .",
|
||||
"lint:ts": "tsc",
|
||||
"lint:links": "node scripts/linkValidator.js 'docs/**/*.md?(x)'",
|
||||
"lint:md": "npx markdownlint-cli docs",
|
||||
"lint:md": "npx -y markdownlint-cli docs",
|
||||
"lint:biome": "biome check .",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
|
|
Loading…
Reference in New Issue