chore(dev): replace preview fixture with local demo site #68
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 JS and CSS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| paths: | |
| - 'source/js/**' | |
| - 'source/css/**' | |
| jobs: | |
| build: | |
| if: "${{ github.actor != 'github-actions[bot]' && contains(github.event.head_commit.message, 'ci: build and update source/js/build and source/css/build') == false }}" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false # Prevent using GITHUB_TOKEN automatically | |
| fetch-depth: 0 # Fetch all history for accurate file diffs | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20.x' # Specify your Node.js version | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.29.3 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Project | |
| run: pnpm run build | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| - name: Commit and Push Changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git add source/js/build source/css/build | |
| # Check if there are any changes | |
| if ! git diff --cached --quiet; then | |
| git commit -m "ci: build and update source/js/build and source/css/build [skip ci]" | |
| git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:${GITHUB_REF#refs/heads/} | |
| else | |
| echo "No changes to commit" | |
| fi |