test: 测试hash #757
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: Auto Deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'dev' | |
paths-ignore: | |
- '.github/**' | |
- '**/*.test.js' | |
- '**/*.test.ts' | |
pull_request: | |
branches-ignore: | |
- 'deploy' | |
- 'deploy-beta' | |
paths-ignore: | |
- '.github/**' | |
- '**/*.test.js' | |
- '**/*.test.ts' | |
workflow_dispatch: | |
branches-ignore: | |
- 'deploy' | |
- 'deploy-beta' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build app | |
run: pnpm run build | |
- name: Get update infos | |
if: ${{ github.event_name == 'push' && github.ref_name =='main' }} | |
run: echo "$(git log --pretty=format:%s --grep='^feat(' --grep='^fix(' --grep='^feat:' --grep='^fix:' '${{ github.event.before }}...${{ github.event.after }}' | grep -v Merge)" > dist/CHANGELOG.md | |
- name: Deploy App | |
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: deploy | |
force: false | |
- name: Purge ChangeLog | |
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
run: curl -L https://purge.jsdelivr.net/gh/zvonimirsun/iszy-tools@deploy/CHANGELOG.md | |
- name: Deploy App Beta | |
if: ${{ github.event_name == 'push' && github.ref_name == 'dev' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist | |
branch: deploy-beta | |
force: false |