-
-
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.
Merge pull request #2 from manchenkoff/docs
Docs
- Loading branch information
Showing
5 changed files
with
1,018 additions
and
875 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Publish Docs | ||
|
||
env: | ||
node_version: 20 | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
workflow_dispatch: # manual trigger | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./docs | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Detect package manager | ||
id: detect-package-manager | ||
run: | | ||
if [ -f "${{ github.workspace }}/yarn.lock" ]; then | ||
echo "manager=yarn" >> $GITHUB_OUTPUT | ||
echo "command=install" >> $GITHUB_OUTPUT | ||
exit 0 | ||
elif [ -f "${{ github.workspace }}/package.json" ]; then | ||
echo "manager=npm" >> $GITHUB_OUTPUT | ||
echo "command=ci" >> $GITHUB_OUTPUT | ||
exit 0 | ||
else | ||
echo "Unable to determine package manager" | ||
exit 1 | ||
fi | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node_version }} | ||
cache: ${{ steps.detect-package-manager.outputs.manager }} | ||
|
||
- name: Restore cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
dist | ||
.nuxt | ||
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} | ||
restore-keys: | | ||
${{ runner.os }}-nuxt-build- | ||
- name: Install dependencies | ||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} | ||
|
||
- name: Build pages preset | ||
run: ${{ steps.detect-package-manager.outputs.manager }} run build:pages | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./.output/public | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
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
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
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
Oops, something went wrong.