[*] Add rolling tag #5
This file contains hidden or 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: Deploy Action | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| action_git_path: "./action/" | |
| main_git_path: "./main/" | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v6 | |
| with: | |
| path: ${{ env.main_git_path }} | |
| - name: Checkout action | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: "action" | |
| path: ${{ env.action_git_path }} | |
| - name: npm install | |
| working-directory: ${{ env.main_git_path }} | |
| run: | | |
| npm install | |
| - name: Build gitcc | |
| working-directory: ${{ env.main_git_path }} | |
| run: | | |
| npm run bundle | |
| - name: Remove old files | |
| working-directory: ${{ env.action_git_path }} | |
| run: | | |
| rm -rf ./* | |
| - name: Copy new files | |
| run: | | |
| mkdir -p ${{ env.action_git_path }}/dist/ | |
| cp -f ${{ env.main_git_path }}/README.md ${{ env.action_git_path }} | |
| cp -rf ${{ env.main_git_path }}/dist* ${{ env.action_git_path }}/ | |
| cp -f ${{ env.main_git_path }}/action.yml ${{ env.action_git_path }} | |
| - name: Push new files | |
| working-directory: ${{ env.action_git_path }} | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git add . | |
| git diff-index --quiet HEAD || git commit -am "[action] Build of ${{ github.sha }}" | |
| git push | |
| - name: Move rolling tag | |
| working-directory: ${{ env.action_git_path }} | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git tag -f v3 | |
| git push -f origin v3 | |
| commit-check: | |
| name: Commit Check | |
| runs-on: ubuntu-latest | |
| needs: deploy | |
| steps: | |
| - name: Commit Check | |
| uses: IceflowRE/gitcc@action | |
| with: | |
| validator: "simpletag" |