47 lines
1 KiB
YAML
47 lines
1 KiB
YAML
name: Build and Deploy Dist
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build and Push
|
|
steps:
|
|
- name: Checkout main branch
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup bun.sh
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install
|
|
|
|
- name: Build
|
|
run: bun run build
|
|
|
|
- name: Checkout build branch
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: build
|
|
path: build
|
|
|
|
- name: Copy dist to build branch
|
|
run: |
|
|
rm -rf build/*
|
|
rm -rf build/.*
|
|
mkdir -p build/dist
|
|
cp -R dist/* build/dist/
|
|
|
|
- name: Commit and Push changes
|
|
run: |
|
|
cd build
|
|
git config user.name "gitea-actions[bot]"
|
|
git config user.email "gitea-actions[bot]@git.z0x.ca"
|
|
git add .
|
|
git commit -m "ci(dist): build dist" || echo "No changes to commit"
|
|
git push origin build
|