Files
tern-web/.gitea/workflows/release.yml
T
Mateusz PstruchaandClaude Opus 5.5 9533392c81
CI / build (pull_request) Successful in 25s
🚀 publish straight to the bucket
The release builds and uploads with ygg/actions/static-publish, instead of
deploying static-server through kara.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:13:05 +01:00

61 lines
1.7 KiB
YAML

name: Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: rocky-10
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run check
# The API is its own origin when deployed. Overridable with the
# TERN_API_URL repository variable.
- name: Build
run: npm run build
env:
VITE_TERN_API: ${{ vars.TERN_API_URL || 'https://tern-api.mtps.pl' }}
- name: Create release archive
run: |
VERSION="${GITHUB_REF_NAME#v}"
# Archive the *contents* of dist/ rather than dist/ itself, so it
# untars straight into an nginx web root.
tar -czf "tern-web-${VERSION}.tgz" -C dist .
sha256sum "tern-web-${VERSION}.tgz" > "tern-web-${VERSION}.tgz.sha256"
- name: Create release
uses: akkuman/gitea-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
server_url: ${{ gitea.server_url }}
tag_name: ${{ gitea.ref_name }}
name: ${{ gitea.ref_name }}
files: |-
tern-web-*.tgz
tern-web-*.tgz.sha256
# Straight to the bucket, with a key that only reaches it. The bucket and
# the nginx site come from deployments/tern-web.yml in ygg/deployments.
- name: Publish
uses: https://git.app.ygg/ygg/actions/static-publish@v2
with:
path: dist
bucket: tern.mtps.pl
access-key-id: ${{ secrets.STATIC_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.STATIC_SECRET_ACCESS_KEY }}