Skip to content

v1 of new site

v1 of new site #4

Workflow file for this run

# Triggered on version tags (v*) or manually.
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0, v1.0.0-beta.1)'
required: true
jobs:
validate:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
VERSION="${{ github.ref_name }}"
else
VERSION="${{ inputs.version }}"
fi
if ! echo "$VERSION" | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$'; then
echo "Error: Invalid version format: $VERSION"
echo "Expected: vMAJOR.MINOR.PATCH[-prerelease][+metadata]"
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Version: $VERSION"
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: 🚀 Test 🚀
run: just install && just lint && just build
deploy:
needs: [test, validate]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup just
run: |
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: 🚀 Deploy 🚀
run: just deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}