-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4eba8f7
commit ed0e247
Showing
1 changed file
with
32 additions
and
13 deletions.
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 |
---|---|---|
@@ -1,21 +1,40 @@ | ||
on: push | ||
name: Build and deploy GH Pages | ||
name: Assorion Website Deploy | ||
|
||
env: | ||
ZOLA_VERSION: "0.15.3" | ||
SOURCE_BRANCH: "main" | ||
TARGET_BRANCH: "gh-pages" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
issues: write | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'latest' | ||
- name: build_and_deploy | ||
uses: shalzz/zola-deploy-action@v0.18.0 | ||
env: | ||
PAGES_BRANCH: gh-pages | ||
TOKEN: ${{ secrets.GITHUB_TOKEN}} | ||
- name: Check out repo | ||
uses: actions/checkout@main | ||
- name: Install zola | ||
run: | | ||
set -x | ||
wget -O - \ | ||
"https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \ | ||
| sudo tar xzf - -C /usr/local/bin | ||
- name: Generate HTML | ||
run: zola build | ||
- name: Deploy to gh-pages | ||
if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', env.SOURCE_BRANCH) }} | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./gh-pages | ||
force_orphan: true |