Skip to content

Commit

Permalink
added workflow to build and deploy pages
Browse files Browse the repository at this point in the history
  • Loading branch information
yianchenhpe committed Jun 28, 2024
1 parent d215698 commit b176e86
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

name: pages-build-deployment
run-name: pages build and deployment

on:
push:
branches:
- docs

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: docs
submodules: 'recursive'

- name: Build Image
run: |
docker build -t my_image ./.devcontainer
- name: Run Container
run: |
docker run -t -d --name my_container my_image
- name: Build
run: |
set -x
docker exec -i my_container mkdir dragon
docker cp ./ my_container:/dragon
docker exec -i my_container bash -c "cd dragon && source /etc/profile.d/modules.sh && source hack/clean_build && cd doc && make"
docker cp my_container:/dragon/doc .
rm -rf ./external
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .

# Deployment job
deploy:
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit b176e86

Please sign in to comment.