Added Color assingment for techniques #101
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 | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set build mode | |
| run: | | |
| if [[ $GITHUB_REF == 'refs/heads/dev' ]]; then | |
| echo "NODE_ENV=development" >> $GITHUB_ENV | |
| echo "BUILD_MODE=development" >> $GITHUB_ENV | |
| else | |
| echo "NODE_ENV=production" >> $GITHUB_ENV | |
| echo "BUILD_MODE=production" >> $GITHUB_ENV | |
| fi | |
| - name: Build project | |
| run: | | |
| if [[ $GITHUB_REF == 'refs/heads/dev' ]]; then | |
| npm run build:dev | |
| else | |
| npm run build:prod | |
| fi | |
| - name: Deploy dev to /dev/ | |
| if: github.ref == 'refs/heads/dev' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: dist/dev # Ensure this matches your dev build output | |
| target-folder: dev # Deploy to /dev folder | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| clean: false # Don't overwrite root or /dev folder | |
| # - name: Deploy main to root | |
| # if: github.ref == 'refs/heads/main' | |
| # uses: JamesIves/github-pages-deploy-action@v4 | |
| # with: | |
| # branch: gh-pages | |
| # folder: dist # Use the production build folder | |
| # target-folder: '' # Deploy to the root folder | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| # clean: true # Clear root before deploying main | |
| # - name: Deploy to GitHub Pages | |
| # uses: JamesIves/github-pages-deploy-action@v4 | |
| # with: | |
| # branch: gh-pages | |
| # folder: ${{ github.ref == 'refs/heads/dev' && 'dist/dev' || 'dist' }} # Deploy from dist/dev for dev branch, dist for main (prod) | |
| # target-folder: ${{ github.ref == 'refs/heads/dev' && 'dev' || '' }} # Deploy to /dev for dev branch, root for main | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| # force: false |