This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Merge pull request #15 from shikajiro/del-label #60
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: Release latest tag | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
push-latest-tag: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- name: Checkout release | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git checkout release | |
git merge origin/main --no-commit --no-ff | |
- name: Cache npm | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm- | |
- name: Build | |
run: | | |
npm install | |
npm run build | |
- name: Commit | |
run: | | |
git add dist -f | |
git diff-index --quiet HEAD || (git commit -m"update build ${{ github.run_number }}" && git tag latest -f) | |
- name: Push changes | |
run: | | |
git push \ | |
"https://${{ github.actor }}:${{ secrets.MY_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" \ | |
HEAD:release \ | |
-f \ | |
--tags |