mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-05-13 17:11:52 +00:00
16097d4633
Took 7 minutes
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: Build and update README on main
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-readme:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout dev branch
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: dev
|
|
|
|
- name: Install Bun
|
|
uses: oven-sh/setup-bun@v1
|
|
|
|
- name: Check for bun.lockb
|
|
run: |
|
|
if [ ! -f "bun.lockb" ]; then
|
|
echo "❌ bun.lockb not found. Aborting."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Run build script (bun run build)
|
|
run: bun run build
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Switch to main branch
|
|
run: |
|
|
git fetch origin main
|
|
git checkout main
|
|
|
|
- name: Copy README from dev
|
|
run: |
|
|
git checkout dev -- README.md
|
|
|
|
- name: Commit and push changes to main
|
|
env:
|
|
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
run: |
|
|
git add README.md
|
|
git commit -m "Update README.md from dev build" || echo "No changes to commit"
|
|
git push https://x-access-token:${TOKEN}@github.com/${{ github.repository }} main
|