Files
Mateusz PstruchaandClaude Opus 5.5 036b4bbc08 🚀 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:04 +01:00

94 lines
2.8 KiB
YAML

name: Release
# v1.2.3 -> build folio@FOLIO_REF against this repo's photos/ and profile/,
# release ig.mtps.pl-1.2.3.tgz, publish to ig.mtps.pl
on:
push:
tags: ['v*']
env:
# folio version the site is built with, bump to pick up app changes
FOLIO_REF: v0.4.0
jobs:
release:
runs-on: rocky-10
steps:
- name: Check out content
uses: actions/checkout@v4
- name: Check out folio
uses: actions/checkout@v4
with:
repository: mtps/folio
ref: ${{ env.FOLIO_REF }}
path: folio
- name: Derive version
id: meta
run: |
VERSION="${GITHUB_REF_NAME#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "$VERSION"
# Version comes from the packageManager field in folio's package.json.
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: folio/package.json
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: folio/pnpm-lock.yaml
- name: Install dependencies
working-directory: folio
run: pnpm install --frozen-lockfile
- name: Type check
working-directory: folio
run: FOLIO_CONTENT="$GITHUB_WORKSPACE" pnpm check
- name: Build
working-directory: folio
run: FOLIO_CONTENT="$GITHUB_WORKSPACE" pnpm build
# Originals carry EXIF (GPS, exact time); only resized copies may ship.
- name: Check published images for EXIF
working-directory: folio
run: pnpm check:metadata
- name: Create release archive
env:
VERSION: ${{ steps.meta.outputs.version }}
run: |
NAME="${{ gitea.event.repository.name }}-${VERSION}.tgz"
# Archive the *contents* of dist/ rather than dist/ itself, so it
# untars straight into a web root.
tar -czf "$NAME" -C folio/dist .
sha256sum "$NAME" > "$NAME.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: |-
${{ gitea.event.repository.name }}-*.tgz
${{ gitea.event.repository.name }}-*.tgz.sha256
# Straight to the bucket, with a key that only reaches it. The bucket and
# the nginx site come from deployments/ig-mtps-pl.yml in ygg/deployments.
- name: Publish
uses: https://git.app.ygg/ygg/actions/static-publish@v2
with:
path: folio/dist
bucket: ig.mtps.pl
access-key-id: ${{ secrets.STATIC_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.STATIC_SECRET_ACCESS_KEY }}