Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bad-tag-desc
Browse files Browse the repository at this point in the history
  • Loading branch information
hry-gh committed Oct 31, 2024
2 parents 6c30664 + b7529c2 commit cb54e8e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 14 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ jobs:
- name: Build index
run: npm run build:index

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Deploy project
uses: JamesIves/[email protected]
with:
path: "./public"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
folder: ./public
clean-exclude: pr-preview/
force: false
57 changes: 57 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy PR previews

on:
pull_request_target:
branches:
- main

paths:
- "**/*.*"
- "!package.json"
- "!.github/workflows"

env:
DEPLOY_REPO_OWNER: OpenDreamProject
DEPLOY_REPO: od-dm-reference

concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Install Zora
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install Stork
uses: baptiste0928/[email protected]
with:
crate: stork-search
version: "1.6.0"

- name: Build project
run: npm run build -- -u "https://ref.opendrea.am/pr-preview/pr-${{ github.event.number }}"

- name: Build index
run: |
npm run build:search-config -- -u "https://ref.opendre.am/pr-preview/pr-${{ github.event.number }}"
npm run build:search-index
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./public/
umbrella-dir: ./pr-preview/
deploy-repository: ${{ env.DEPLOY_REPO_OWNER }}/${{ env.DEPLOY_REPO }}
token: ${{ secrets.PREVIEW_TOKEN }}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"cross-env": "^7.0.3"
},
"scripts": {
"build": "npm run build:css && npm run build:zola",
"build:css": "cross-env NODE_ENV=production tailwindcss -m -i styles/index.css -o static/index.css",
"build:zola": "cross-env ZOLA_ENV=prod zola build",
"build:index": "zola --config config.index.toml build -o index && stork build --input index/toml/index.html --output public/search.st",
"watch": "concurrently 'npm:watch:css' 'npm:watch:zola'",
"watch:css": "tailwindcss -m -w -i styles/index.css -o static/index.css",
"watch:zola": "zola serve",
"build": "NODE_ENV=production tailwindcss -m -i styles/index.css -o static/index.css; ZOLA_ENV=prod zola build",
"build:search-config": "zola --config config.index.toml build -o index",
"build:search-index": "stork build --input index/toml/index.html --output public/search.st",
"build:index": "npm run build:search-config; npm run build:search-index",
"format": "node tools/format.js"
},
"author": "",
Expand Down

0 comments on commit cb54e8e

Please sign in to comment.