Change Logo #2
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: Release Latest Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Remove old files | |
| run: | | |
| rm -rf dist | |
| mkdir dist | |
| - name: Build project | |
| run: npm run build | |
| - name: Clean up source files | |
| run: | | |
| find . -mindepth 1 -maxdepth 1 ! -name 'dist' ! -name '.git' -exec rm -rf {} + | |
| - name: Copy files from dist | |
| run: | | |
| mv dist/* . | |
| rmdir dist | |
| - name: Version File | |
| run: | | |
| date +%s > version | |
| - name: Set up Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout --orphan latest-release | |
| - name: Commit and push changes | |
| run: | | |
| git add . | |
| git commit -m "Latest build $(date "+%Y-%m-%d %H:%M:%S")" | |
| git push -f origin latest-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |