diff --git a/.github/workflows/deploy-blog.yml b/.github/workflows/deploy-blog.yml index c129f5a..c58f4f4 100644 --- a/.github/workflows/deploy-blog.yml +++ b/.github/workflows/deploy-blog.yml @@ -1,9 +1,12 @@ name: Deploy Astro Blog on: - push: - branches: - - blog-content + workflow_run: + workflows: + - Sync master into blog-content + types: + - completed + workflow_dispatch: @@ -20,16 +23,8 @@ concurrency: jobs: build-and-deploy: if: > - github.event_name == 'push' || - github.event_name == 'workflow_dispatch' || - ( - github.event_name == 'discussion' && - github.event.discussion.category.slug == 'comments' - ) || - ( - github.event_name == 'discussion_comment' && - github.event.discussion.category.slug == 'comments' - ) + github.event_name != 'workflow_run' || + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest env: diff --git a/.github/workflows/sync-master-to-blog-content.yml b/.github/workflows/sync-master-to-blog-content.yml new file mode 100644 index 0000000..43bda3a --- /dev/null +++ b/.github/workflows/sync-master-to-blog-content.yml @@ -0,0 +1,37 @@ +name: Sync master into blog-content + +on: + push: + branches: + - master + +permissions: + contents: write + +jobs: + merge-master-into-blog-content: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Checkout blog-content + run: | + git checkout blog-content + git pull origin blog-content + + - name: Merge master into blog-content + run: | + git merge origin/master --no-edit + + - name: Push blog-content + run: | + git push origin blog-content \ No newline at end of file