mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-18 01:07:22 +00:00
ci: update website build process (#2808)
* ci: update website build process * ci: also trigger on ci file change * ci: fix id used two times * ci: fix missing work dir
This commit is contained in:
@@ -8,11 +8,13 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- "site/**"
|
- "website/**"
|
||||||
|
- ".github/workflows/site.yml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["main"]
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- "site/**"
|
- "website/**"
|
||||||
|
- ".github/workflows/site.yml"
|
||||||
|
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -29,9 +31,6 @@ jobs:
|
|||||||
# The type of runner that the job will run on
|
# The type of runner that the job will run on
|
||||||
name: Build Docusaurus
|
name: Build Docusaurus
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: ./website
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||||
@@ -39,23 +38,42 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
- name: Get yarn cache directory path (root)
|
||||||
|
id: yarn-cache-dir-path-root
|
||||||
|
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache-dir-path-root.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-yarn-
|
||||||
|
- name: yarn install (root)
|
||||||
|
run: yarn install --immutable
|
||||||
|
- name: Build all pkg
|
||||||
|
run: yarn release-build
|
||||||
|
- name: Build docs
|
||||||
|
run: yarn build:doc
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||||
|
working-directory: ./website
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-site-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-site-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-site-
|
${{ runner.os }}-yarn-site-
|
||||||
|
- run: yarn install --immutable
|
||||||
|
working-directory: ./website
|
||||||
- name: Build website
|
- name: Build website
|
||||||
run: |
|
run: yarn build
|
||||||
yarn
|
working-directory: ./website
|
||||||
yarn build
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v1
|
uses: actions/upload-pages-artifact@v1
|
||||||
with:
|
with:
|
||||||
path: ./website/build
|
path: ./website/build
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
|
|||||||
Reference in New Issue
Block a user