Skip to content

Commit

Permalink
ci: only deploy gh pages on push on main
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileRolley committed Jul 26, 2024
1 parent 0437622 commit 0460910
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Build rules

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

jobs:
build:
Expand All @@ -27,32 +22,3 @@ jobs:
- id: build
name: Compile the rules
run: yarn build

deploy_gh_page:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- id: install
name: Install dependencies
run: yarn install --immutable && yarn install --immutable --cwd doc

- id: doc:build
name: Build the documentation
run: yarn doc:build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: doc/build
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy GitHub Pages

on:
workflow_run:
workflows: ["Build rules"]
branches:
- main
types:
- completed

jobs:
deploy_gh_page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "yarn"

- id: install
name: Install dependencies
run: yarn install --immutable && yarn install --immutable --cwd doc

- id: doc:build
name: Build the documentation
run: yarn doc:build
- name: Deploy
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: doc/build
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0460910

Please sign in to comment.