Skip to content

Commit

Permalink
Add Preview workflow that works with forks (FOME-Tech#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l authored Sep 24, 2023
1 parent 04a6a7f commit 75d48d2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build-preview.yml
Original file line number Diff line number Diff line change
@@ -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/
23 changes: 0 additions & 23 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 75d48d2

Please sign in to comment.