You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.3 KiB
84 lines
2.3 KiB
name: Release Web
|
|
|
|
on:
|
|
release:
|
|
types: [released, prereleased]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release-web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
# --- Setup Node.js and pnpm ---
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
# --- Cache pnpm Dependencies ---
|
|
- name: Cache pnpm Dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.pnpm-store
|
|
packages/web/node_modules
|
|
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-
|
|
|
|
- name: Install dependencies
|
|
working-directory: packages/web
|
|
run: pnpm install
|
|
|
|
- name: Create Web App Release Archive
|
|
working-directory: packages/web
|
|
run: pnpm run package
|
|
|
|
- name: Upload Web App Archive
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web-build
|
|
if-no-files-found: error
|
|
path: packages/web/dist/build.tar
|
|
|
|
- name: Attach Web Archive to GitHub Release
|
|
run: gh release upload ${{ github.event.release.tag_name }} packages/web/dist/build.tar
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Build Container Image
|
|
id: build-container
|
|
uses: redhat-actions/buildah-build@v2
|
|
with:
|
|
containerfiles: |
|
|
./packages/web/infra/Containerfile
|
|
image: ghcr.io/${{ github.repository }}
|
|
tags: latest, ${{ github.event.release.tag_name }}
|
|
oci: true
|
|
platforms: linux/amd64, linux/arm64
|
|
|
|
- name: Push Container to GHCR
|
|
id: push-to-registry
|
|
uses: redhat-actions/push-to-registry@v2
|
|
with:
|
|
image: ${{ steps.build-container.outputs.image }}
|
|
tags: ${{ steps.build-container.outputs.tags }}
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Output Image URL
|
|
run: echo "🖼️ Image pushed to ${{ steps.push-to-registry.outputs.registry-paths }}"
|
|
|