Skip to content

Add config API endpoints and implement environment switching #15

Add config API endpoints and implement environment switching

Add config API endpoints and implement environment switching #15

Workflow file for this run

name: Build and Push to Build Branch
on:
pull_request:
types: [closed]
branches:
- development # Triggers when a PR is opened against development
permissions:
contents: write
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: "npm"
- name: Install and Build
run: |
npm ci
npm run build
- name: Deploy to Build Branch
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist # ONLY files in dist move to the build branch
branch: build # The target branch
clean: true # Deletes everything else (README, LICENSE, etc.)
commit-message: "Deploying to build branch from PR #${{ github.event.pull_request.number }}"
- name: Auto-bump Semantic Version
id: bump
run: |
git fetch --tags
# Get latest tag, default to v0.0.0 if none
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "Latest tag: $LATEST_TAG"
# Strip 'v' and split into parts
VERSION=${LATEST_TAG#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
# Increment patch
PATCH=$((PATCH + 1))
NEW_TAG="v$MAJOR.$MINOR.$PATCH"
echo "New tag: $NEW_TAG"
echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT
- name: Create Tag and Update VERSIONS
run: |
git checkout development
git tag -a "${{ steps.bump.outputs.new_tag }}" -m "Release ${{ steps.bump.outputs.new_tag }} from commit ${{ github.sha }}"
git push origin "${{ steps.bump.outputs.new_tag }}"
# Append new version to VERSIONS file
echo "${{ steps.bump.outputs.new_tag }}" >> VERSIONS
git add VERSIONS
git commit -m "chore: append ${{ steps.bump.outputs.new_tag }} to VERSIONS"
git push origin development