Skip to content
Merged
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
99 changes: 99 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Deploy to GitHub Pages with Version Increment

on:
push:
branches:
- main

permissions:
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Read and Increment Version
id: version
run: |
# Check if VERSION.txt exists
if [ ! -f _includes/VERSION.txt ]; then
echo "ERROR: _includes/VERSION.txt not found"
exit 1
fi

# Read current version
CURRENT_VERSION=$(cat _includes/VERSION.txt)
echo "Current version: $CURRENT_VERSION"

# Increment version
NEW_VERSION=$((CURRENT_VERSION + 1))
echo "New version: $NEW_VERSION"

# Write new version (without trailing newline to match original format)
echo -n "$NEW_VERSION" > _includes/VERSION.txt

# Set output for later steps
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Build with Jekyll
run: bundle exec jekyll build
env:
JEKYLL_ENV: production

- name: Commit Version File
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add _includes/VERSION.txt

# Only commit and push if there are changes
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: bump version to ${{ steps.version.outputs.version }}"
git push
fi

- name: Create Git Tag
run: |
# Check if tag already exists (could happen with concurrent runs)
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "Tag v${{ steps.version.outputs.version }} already exists, skipping tag creation"
else
git tag -a "v${{ steps.version.outputs.version }}" -m "Release version ${{ steps.version.outputs.version }}"
git push origin "v${{ steps.version.outputs.version }}"
fi

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ A good _heuristic_ for whether a conference should be included is if its name in

Don't forget to **[sign up](http://eepurl.com/c4paYT)** for our once **monthly newsletter.**

## Versioning and Deployments

The site uses an automated versioning system to track each deployment:

- **Version Number**: Every deployment to production automatically increments the version number stored in `_includes/VERSION.txt`
- **Git Tags**: Each deployment is tagged in Git with the format `vXXXX` (e.g., `v1501`)
- **Footer Display**: The current version is displayed in the site footer as `rev.XXXX.`
- **Workflow**: The `.github/workflows/deploy.yml` workflow handles version incrementing, tagging, and deployment on every push to `main`

This versioning system enables:
- Tracking which version of the site is deployed
- Associating bug reports with specific deployments
- Measuring quality metrics across versions (see [ROADMAP.md](ROADMAP.md))


## License

Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Continue to use TCorg to experiment and learn. I want to track quality metrics a

- [x] **Implement `VERSION` file**: Create a plaintext file in the root directory to track SemVer (e.g., `1.0.0`).
- [x] **Footer Integration**: Update the website footer to dynamically display the current string from the `VERSION` file.
- [ ] **Automated Increments**: Create a workflow to increment the `VERSION` file on every deployment.
- [ ] **Deployment Tagging**: Ensure every production deploy is tagged in Git to match the internal version.
- [x] **Automated Increments**: Create a workflow to increment the `VERSION` file on every deployment.
- [x] **Deployment Tagging**: Ensure every production deploy is tagged in Git to match the internal version.

## Phase 2: Quality Ledger & Metrics
*Goal: Associate every site version with a specific quality snapshot.*
Expand Down