ci: temp version #828
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
name: build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
fetch-tags: true | |
- id: Install | |
uses: wyvox/action-setup-pnpm@v3 | |
- id: Optimize | |
run: pnpm optimize | |
- id: Versioning | |
run: | | |
VERSION=$(git describe --tags --abbrev=8) | |
VERSION=${VERSION#v} | |
echo "Version: $VERSION" | |
jq --arg version "$VERSION" '.version = $version' package.json > tmp.$$.json && mv tmp.$$.json package.json | |
- id: Build | |
env: | |
DOCS_BASE_URL: /${{ github.event.repository.name }}/ | |
DOCS_HOME_URL: https://cloudpss.net/ | |
run: pnpm build | |
- id: Upload | |
if: (!cancelled()) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: build | |
- id: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
if: (!cancelled() && github.event_name == 'push') | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: build | |
force_orphan: true | |
enable_jekyll: false | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
commit_message: ${{ github.event.head_commit.message }} |