Skip to content
Merged

CM #76

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/production-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "studio",
"type": "module",
"version": "0.3.9",
"version": "1.3.9",
"engines": {
"node": ">=22.12.0"
},
Expand Down
Loading