Skip to content

Commit

Permalink
chore: set up github actions ci
Browse files Browse the repository at this point in the history
  • Loading branch information
molisani committed Sep 30, 2024
1 parent 49ebd83 commit 2975fd2
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 31 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Node.js CI

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
actions: read
contents: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- run: npm ci --legacy-peer-deps
- uses: nrwl/nx-set-shas@v4

# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: npx nx affected -t format:check lint build coverage
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build website
run: npx nx run @stricli/docs:build-docs

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"@docusaurus/types": "3.5.2",
"@stricli/core": "^0.0.1",
"docusaurus-plugin-typedoc": "^1.0.5",
"typedoc": "^0.26.7"
"sass": "^1.79.4",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.8"
},
"browserslist": {
"production": [
Expand Down
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@
"git": {
"commitMessage": "chore(release): {version}"
}
},
"namedInputs": {
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"]
}
}
Loading

0 comments on commit 2975fd2

Please sign in to comment.