Files
ig.mtps.pl/.gitea/workflows/release.yml
T
mtpsandClaude Opus 5.5 79c2b69b92
Release / release (push) Successful in 3m39s
Release / deploy (push) Successful in 14s
Build with folio v0.4.0
Waves page background with dark mode, no avatar ring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 13:53:50 +00:00

108 lines
3.1 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, deploy/static.yml (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
outputs:
version: ${{ steps.meta.outputs.version }}
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
# static-server on kara downloads the release asset, so this runs after it
deploy:
needs: release
runs-on: rocky-10
# never run two deploys at once
concurrency:
group: deploy-${{ gitea.repository }}
cancel-in-progress: false
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Deploy
uses: https://git.app.ygg/ygg/actions/deploy@v2
with:
type: static
dist-path: deploy/static.yml
extra-vars: |
static_release=${{ needs.release.outputs.version }}
ssh-key: ${{ secrets.DEPLOY_SSH_KEY }}
known-hosts: ${{ vars.DEPLOY_KNOWN_HOSTS }}