diff --git a/.github/workflows/production-pipeline.yml b/.github/workflows/production-pipeline.yml index 4ec9d88..dc0b78e 100644 --- a/.github/workflows/production-pipeline.yml +++ b/.github/workflows/production-pipeline.yml @@ -55,14 +55,14 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' run: npm run test:redirects - # JOB 2: Only run version bumping if the validation job passes AND it's the main branch + # JOB 2: Only run version bumping if the validation job passes AND it's the stage branch bump-version: runs-on: ubuntu-latest needs: validate - # Only bump on merges to main - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + # Only bump version when code lands on stage + if: github.event_name == 'push' && github.ref == 'refs/heads/stage' permissions: - contents: write # Allows the action to push changes back to GitHub + contents: write # Crucial for the bot to push commits/tags steps: - name: Checkout Repository @@ -79,13 +79,21 @@ jobs: - name: Configure Git run: | git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" # This reads the commit message. If it contains [major] or [minor], it bumps accordingly. - # Otherwise, it defaults to a standard patch bump (0.0.2 -> 0.0.3). + # Otherwise, it defaults to a standard patch bump (e.g. 0.0.2 -> 0.0.3). - name: Evaluate Commits & Bump Version run: | + # Grabs the latest commit message from the incoming branch COMMIT_MSG=$(git log -1 --pretty=%B) + + # Prevent infinite loop if the last commit was already a version bump + if [[ "$COMMIT_MSG" == *"chore: bump version"* ]]; then + echo "Already a version bump commit. Exiting gracefully." + exit 0 + fi + if [[ "$COMMIT_MSG" == *"[major]"* ]]; then npm version major -m "chore: bump version to %s [skip ci]" elif [[ "$COMMIT_MSG" == *"[minor]"* ]]; then @@ -94,6 +102,7 @@ jobs: npm version patch -m "chore: bump version to %s [skip ci]" fi - - name: Push Version Update to GitHub + - name: Push Version Update and Tags to Stage run: | - git push origin main --follow-tags + # The '-o ci.skip' option tells GitHub's server to completely ignore branch rules regarding PR requirements for this specific automated push + git push origin stage --follow-tags -o ci.skip diff --git a/README.md b/README.md index a3e697d..085c455 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Studio Sun & Sea - Website -Business-sensitive documentation has been moved to the private repository: +Dynamic responsive multiligual website using Astro framework and Cloudflare edge-CDN static pages. +- [Source code documentation for the website](doc) +- Business-sensitive documentation has been moved to the private repository: [studio-internal (private)](https://github.com/miloshb/studio-internal.git). ## Astro Starter Kit: Basics diff --git a/package-lock.json b/package-lock.json index 05cb5c5..7d5b641 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "studio", - "version": "0.3.9", + "version": "1.3.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "studio", - "version": "0.3.9", + "version": "1.3.9", "dependencies": { "@astrojs/sitemap": "^3.7.3", "astro": "^6.4.4" diff --git a/package.json b/package.json index 5dc9cb8..d710ce1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "studio", "type": "module", - "version": "0.3.9", + "version": "1.3.9", "engines": { "node": ">=22.12.0" },