Skip to content

Commit

Permalink
chore: nix in actions, deploy website after API reference update
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Jun 25, 2024
1 parent 670394a commit 29b60df
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 23 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
workflow_dispatch:

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

- name: Install Dependencies
run: nix-shell -p yarn --run "yarn install --frozen-lockfile"

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build
- name: Build
run: nix-shell -p yarn --run "yarn build"

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
Expand Down
21 changes: 9 additions & 12 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

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

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
- name: Install Dependencies
run: nix-shell -p yarn --run "yarn install --frozen-lockfile"

- name: Test Build
run: nix-shell -p yarn --run "yarn build"
17 changes: 17 additions & 0 deletions .github/workflows/update-admin-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,20 @@ jobs:
short_commit_hash=$(echo ${{ env.CURRENT_COMMIT_HASH }} | cut -c 1-7)
git commit -m "docs: admin api reference update to blink commit $short_commit_hash"
git push origin main
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7

- name: Install Dependencies
run: nix-shell -p yarn --run "yarn install --frozen-lockfile"

- name: Build
run: 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: ./build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
17 changes: 17 additions & 0 deletions .github/workflows/update-public-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,20 @@ jobs:
short_commit_hash=$(echo ${{ env.CURRENT_COMMIT_HASH }} | cut -c1-7)
git commit -m "docs: public api reference update to blink commit $short_commit_hash"
git push origin main
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v7

- name: Install Dependencies
run: nix-shell -p yarn --run "yarn install --frozen-lockfile"

- name: Build
run: 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: ./build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 comments on commit 29b60df

Please sign in to comment.