Skip to content

Commit

Permalink
chore: nix in actions, deploy website after API reference update (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms authored Jun 26, 2024
1 parent a08b178 commit 9b99dfa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 24 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- main
paths:
- 'website/**'
workflow_dispatch:

jobs:
deploy:
Expand All @@ -14,23 +15,18 @@ jobs:
permissions:
contents: write
steps:
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
- name: Install Dependencies
run: |
cd website
yarn install --frozen-lockfile
- name: Build website
- name: Build Website
run: |
cd website
yarn build
nix-shell -p yarn --run "yarn build"
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/website-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,18 @@ on:

jobs:
test-deploy:
name: Test deployment
name: Test Deployment
runs-on: ubuntu-latest
steps:
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install yarn
run: npm install -g yarn

- name: Install dependencies
- name: Install Dependencies
run: |
cd website
yarn install --frozen-lockfile
- name: Test build
nix-shell -p yarn --run "yarn install --frozen-lockfile"
- name: Test Build
run: |
cd website
yarn build
nix-shell -p yarn --run "yarn build"
22 changes: 20 additions & 2 deletions .github/workflows/website-update-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,35 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build the API reference
run: |
cd website
npm install spectaql
npx spectaql spectaql-config.yml -t static -f api-reference.html
- name: Deploy the API reference
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add website/static/api-reference.html
git commit -m "docs: api reference update: $GITHUB_SHA"
git push origin HEAD:main
- name: Install Website Dependencies
run: |
cd website
nix-shell -p yarn --run "yarn install --frozen-lockfile"
- name: Build Website
run: |
cd website
nix-shell -p yarn --run "yarn build"
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 comments on commit 9b99dfa

Please sign in to comment.