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: Build and Copy to Portfolio | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout exercisefinder | |
| uses: actions/Checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: install dependencies | |
| run: npm ci | |
| - name: Build vite app | |
| run: npm run build | |
| - name: clone Portfolio repo | |
| run: git clone https://x-access-token:${{ secrets.NEXT_REPO_TOKEN }}@github.com/samdeitz/personal-portfolio.git | |
| - name: copy build to portfolio | |
| run: | | |
| rm -rf personal-portfolio/public/exercisefinder | |
| mkdir -p personal-portfolio/public/exercisefinder | |
| cp -r dist/* personal-portfolio/public/exercisefinder | |
| - name: commit & push | |
| run: | | |
| cd personal-portfolio | |
| git config user.name "exercise-bot" | |
| git config user.email "exercise-bot@github.com" | |
| git add public/exercisefinder | |
| git commit -m "Update exercise finder build" || exit 0 | |
| git push |