From 16097d4633576d3162a4842123a5c391224e824b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=A0s?= <86352901+LucasVbr@users.noreply.github.com> Date: Mon, 14 Jul 2025 00:55:43 +0200 Subject: [PATCH] feat: Rename github folder Took 7 minutes --- .github/workflows/deploy.yaml | 55 +++++++++++++++++++++++++++++++++++ github/workflows/deploy.yaml | 43 --------------------------- 2 files changed, 55 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/deploy.yaml delete mode 100644 github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..fd59e66 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,55 @@ +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 diff --git a/github/workflows/deploy.yaml b/github/workflows/deploy.yaml deleted file mode 100644 index 58a8e66..0000000 --- a/github/workflows/deploy.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build and Commit README - -on: - push: - branches: [dev] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Bun - uses: oven-sh/setup-bun@v1 - - - name: Install dependencies - run: bun install --frozen-lockfile - - - name: 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: Commit README.md to main - run: | - git checkout main - git pull origin main - git checkout dev -- README.md - if git diff --quiet README.md; then - echo "No changes to README.md" - else - git add README.md - git commit -m "chore(readme): update after build [CI]" - git push origin main - fi