Skip to content

Commit

Permalink
Dev (#172)
Browse files Browse the repository at this point in the history
* 📦 ci(.github): added preview workflow for pull requests and docs now deplow to the gh-page

* 📦 ci(preview.yml): added workflow

* 📦 ci(preview-docs.yml): added build scripts for the documentation
  • Loading branch information
prjctimg authored Apr 7, 2024
1 parent d530632 commit efc8528
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 17 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/static.yml → .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,35 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false


jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: build site
uses: JamesIves/github-pages-deploy-action@v4
with:
# Upload entire repository
path: './docs/www'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
folder: ./docs/www
branch: gh-pages
clean-exclude: pr-preview
force: false

34 changes: 34 additions & 0 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy GitHub PAges Preview
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- closed
- reopened

concurrency: preview-${{ github.ref }}
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install and Build
if: github.event.action != 'closed' # skips build step if pr is closed

run: |
npm install
npm run docs
cd docs/assets && npm install
npm run deploy
- name: Deploy PR Preview
uses: rossjrw/[email protected]
with:
token: ${{secrets.GH_PAT}}
preview-branch: main
source-dir: ./docs/www
umbrella-dir: ./docs/pr-preview
action: auto

0 comments on commit efc8528

Please sign in to comment.