Skip to content

Commit

Permalink
Separate CI & CD Workflows (#82)
Browse files Browse the repository at this point in the history
* Separate CI & CD Workflows

* Run CI on any PR

* Only run CD on main

* Remove if check; push requirements already check

* Separate Build & Deploy in CD; Update Action Versions

* Fixed incorrect version targeting
  • Loading branch information
Xilophor authored Jan 23, 2024
1 parent 6e7d810 commit 481c112
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 21 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Wiki CI
on:
pull_request:

env:
NODE_VERSION: 20.x

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install packages
run: npm ci
- name: Build
run: npm run build
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
44 changes: 23 additions & 21 deletions .github/workflows/wiki.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
name: Wiki CI
name: Wiki CD
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
push:
branches-ignore:
- cwdin-backups
- 'crowdin/**'

env:
NODE_VERSION: 18.x
NODE_VERSION: 20.x

jobs:
deploy:
name: Deploy
if: github.ref == 'refs/heads/main'
build:
name: Build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -36,11 +25,24 @@ jobs:
- name: Build
run: npm run build
- name: Configure GitHub Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v4
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Wiki
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

0 comments on commit 481c112

Please sign in to comment.