-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: publish pages using Github Actions
- Loading branch information
Showing
5 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: # allows to be run manually | ||
workflow_call: # when called from another workflow | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
- name: Build site | ||
run: | | ||
mkdir -p _site | ||
find . -maxdepth 1 -mindepth 1 -not -name _site -not -name '*.md' -not -name LICENSE -not -name .github -not -name .gitignore -not -name .git -exec cp -r '{}' _site \; | ||
- name: Save built site for deploy | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: _site | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: # allows to be run manually | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
deploy: | ||
if: github.ref == 'refs/heads/master' | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- id: deployment | ||
name: Deploy to GitHub Pages | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_site |