54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: Host Revenge Bundle
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-host:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Restore Bun cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile --production
|
|
|
|
- name: Build production bundle
|
|
run: bun run build
|
|
|
|
- name: Publish bundle to hosting branch
|
|
run: |
|
|
cp dist/revenge.bundle /tmp/revenge.bundle
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
if git show-ref --verify --quiet "refs/heads/hosting"; then
|
|
git checkout hosting
|
|
git rm -rf .
|
|
else
|
|
git checkout --orphan hosting
|
|
fi
|
|
rm -rf *
|
|
cp /tmp/revenge.bundle ./revenge.bundle
|
|
git add revenge.bundle
|
|
git commit -m "Host bundle from ${GITHUB_SHA}" || true
|
|
git push --force origin hosting
|