-
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
bc3bab0
commit fe29b4c
Showing
2 changed files
with
2,744 additions
and
18 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,30 +1,81 @@ | ||
name: Publish to GitHub Pages | ||
name: Autobuild | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: [ main ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
deployments: write | ||
contents: read | ||
pages: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '22' | ||
- name: Compile frontend | ||
run: pnpm run build | ||
env: | ||
CI: "false" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "./dist" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Build project | ||
run: npm run build | ||
- name: Archive artifact | ||
shell: sh | ||
|
||
run: | | ||
tar \ | ||
--dereference --hard-dereference \ | ||
--directory "$INPUT_PATH" \ | ||
-cvf "$RUNNER_TEMP/artifact.tar" \ | ||
--exclude=.git \ | ||
--exclude=.github \ | ||
. | ||
env: | ||
INPUT_PATH: dist/ | ||
|
||
- name: Publish to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
- name: Upload artifact | ||
id: upload-artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: github-pages | ||
path: ${{ runner.temp }}/artifact.tar | ||
retention-days: 1 | ||
if-no-files-found: error | ||
|
||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: Profile | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Oops, something went wrong.