adding additional project to projects section #47
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 to GitHub Pages (Root Domain) | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18.x | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build Project | |
| run: npm run build | |
| - name: Deploy to GitHub Pages | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git clone --depth=1 --branch=gh-pages https://x-access-token:${{ secrets.PORTFOLIO_ACTIONS_TOKEN }}@github.com/GitForceJedi/gitforcejedi.github.io.git deploy-repo | |
| cp deploy-repo/CNAME /tmp/CNAME || echo "No existing CNAME found" # Save CNAME before deleting everything | |
| rm -rf deploy-repo/* | |
| cp -r build/* deploy-repo/ | |
| [ -f /tmp/CNAME ] && mv /tmp/CNAME deploy-repo/CNAME # Restore CNAME if it exists | |
| cd deploy-repo | |
| git add . | |
| git commit -m "🚀 Overwrite existing site with new deployment" | |
| git push origin gh-pages | |
| env: | |
| PORTFOLIO_ACTIONS_TOKEN: ${{ secrets.PORTFOLIO_ACTIONS_TOKEN }} |