Skip to content

Release v0.15.0

Release v0.15.0 #64

Workflow file for this run

name: CI / CD
on:
push:
branches: [main]
tags: ['v*']
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g. 1.2.3 — must already exist in GHCR)'
required: true
jobs:
test:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy -p proxy -- -D warnings
- name: Run Rust tests
run: cargo test -p proxy
- name: Set up Node
uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
cache-dependency-path: admin-ui/package-lock.json
- name: Install admin-ui dependencies
run: npm ci
working-directory: admin-ui
- name: Run admin-ui tests
run: npm run test:run
working-directory: admin-ui
# docs-site job disabled until docs-site/ is committed to the repo.
# docs-site:
# if: github.event_name == 'push'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v5
# - name: Set up Node
# uses: actions/setup-node@v5
# with:
# node-version: 22
# cache: npm
# cache-dependency-path: docs-site/package-lock.json
# - name: Install docs-site dependencies
# run: npm ci
# working-directory: docs-site
# - name: VitePress build
# run: npm run build
# working-directory: docs-site
publish:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
version: ${{ steps.meta.outputs.version }}
steps:
- uses: actions/checkout@v5
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/getbetweenrows/betweenrows
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
target: prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: [publish]
if: |
always() && (
(needs.publish.result == 'success') ||
(github.event_name == 'workflow_dispatch')
)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v5
- name: Resolve version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "tag=${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ needs.publish.outputs.version }}" >> $GITHUB_OUTPUT
fi
- name: Deploy to Fly.io
uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --image ghcr.io/getbetweenrows/betweenrows:${{ steps.version.outputs.tag }} --app betweenrows
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}