🚀 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>
This commit is contained in:
1 parent
79c2b69b92
commit
036b4bbc08
3 files changed
+10
-62
No files matched your search
@@ -1,7 +1,7 @@
|
||||
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)
|
||||
# release ig.mtps.pl-1.2.3.tgz, publish to ig.mtps.pl
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
@@ -13,8 +13,6 @@ env:
|
||||
jobs:
|
||||
release:
|
||||
runs-on: rocky-10
|
||||
outputs:
|
||||
version: ${{ steps.meta.outputs.version }}
|
||||
steps:
|
||||
- name: Check out content
|
||||
uses: actions/checkout@v4
|
||||
@@ -84,24 +82,12 @@ jobs:
|
||||
${{ 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
|
||||
# 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:
|
||||
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 }}
|
||||
path: folio/dist
|
||||
bucket: ig.mtps.pl
|
||||
access-key-id: ${{ secrets.STATIC_ACCESS_KEY_ID }}
|
||||
secret-access-key: ${{ secrets.STATIC_SECRET_ACCESS_KEY }}
|
||||
@@ -21,6 +21,6 @@ cd ../folio && pnpm install && FOLIO_CONTENT=../ig.mtps.pl pnpm dev
|
||||
Pushing a `v*` tag runs `.gitea/workflows/release.yml`:
|
||||
|
||||
1. It builds folio at `FOLIO_REF` (set in the workflow) against this repo's content, checks that no published image has EXIF location or time, and attaches `ig.mtps.pl-<version>.tgz` to a Gitea release.
|
||||
2. `ygg/actions/deploy@v2` (SSH to kara, Ansible `deploy/static`) then runs static-server for that release on port 11904, behind ig.mtps.pl.
|
||||
2. `ygg/actions/static-publish@v2` uploads the same build straight to the `ig.mtps.pl` bucket.
|
||||
|
||||
To pick up folio changes, bump `FOLIO_REF` and tag a new release.
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
# Static site: https://git.app.ygg/mtps/ig.mtps.pl, built with mtps/folio
|
||||
#
|
||||
# Deployed by .gitea/workflows/release.yml through ygg/actions/deploy
|
||||
# (deploy/static playbook on kara).
|
||||
#
|
||||
# static_release is passed by the release workflow (-e static_release=1.2.3).
|
||||
# For a manual run pass it the same way, there's deliberately no default here.
|
||||
# Release assets are versioned (ig.mtps.pl-<version>.tgz), and static-server
|
||||
# only auto-detects *.tar.gz, so the asset is named explicitly.
|
||||
|
||||
# kept from when the site was released from mtps/folio, so deploys update
|
||||
# that stack instead of starting a second one on the same port
|
||||
static_stack_name: folio
|
||||
|
||||
domain: ig.mtps.pl
|
||||
# /etc/nginx/certs/<cert>.conf on the nginx host
|
||||
cert: mtps.pl
|
||||
|
||||
# static_service replaces the role default as a whole, so every key is required
|
||||
static_service:
|
||||
name: static
|
||||
image: "{{ gitea_host }}/ygg/static-server:latest"
|
||||
environment:
|
||||
GITEA_REPOSITORY_URL: "https://{{ gitea_host }}/mtps/ig.mtps.pl"
|
||||
GITEA_RELEASE: "v{{ static_release }}"
|
||||
GITEA_ASSET_NAME: "ig.mtps.pl-{{ static_release }}.tgz"
|
||||
SSL_CERT_FILE: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
|
||||
volumes:
|
||||
- /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:ro
|
||||
ports:
|
||||
- target: 8080
|
||||
published: 11904
|
||||
protocol: tcp
|
||||
mode: ingress
|
||||
replicas: 3
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
Reference in new issue
Block a user