Skip to content

Commit

Permalink
chore(ci): Create automatic dev branch
Browse files Browse the repository at this point in the history
In *theory*, once CI is green this will auto-merge to main
  • Loading branch information
VorpalBlade committed Aug 17, 2024
1 parent ce72d20 commit d90322b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 8 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI (dev)

permissions:
contents: read

on:
push:
branches: [ "dev" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lints:
name: "Lint"
uses: ./.github/workflows/act_lint.yml
permissions:
contents: read
security-events: write

build:
name: "Build"
uses: ./.github/workflows/act_build.yml

mdbook:
name: "Mdbook"
uses: ./.github/workflows/act_mdbook.yml

push-to-main:
needs: [lints, build, mdbook]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# Shallow checkouts don't work for merging, so pull in enough history to likely work
fetch-depth: 75
- name: Update main
run: |
set -xe
git fetch origin main
git checkout main
git pull origin main
git merge --ff-only dev
- uses: ad-m/github-push-action@v0.8.0
name: Push to main
with:
github_token: ${{ secrets.GH_PAT }}
branch: main
10 changes: 2 additions & 8 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ permissions:
contents: write

on:
workflow_run:
workflows: ["Build"]
branches:
- main
types:
- completed
push:
branches: [ "main" ]

concurrency:
group: ${{ github.workflow }}
Expand All @@ -20,8 +16,6 @@ jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
# Only run if the build was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down

0 comments on commit d90322b

Please sign in to comment.