diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 4c82af4a..ea1c2590 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -1,18 +1,22 @@ name: Publish content before merging on: - merge_group: + push: + # to be changed to 'main' + branches: ['publish-article-pipeline'] jobs: - publish: + check-unpublished: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - run: npm ci - - run: npm run build:utils - - run: npm run posts:publish - + - name: Should publish + id: should-publish + run: echo "::set-output name=should-publish::$([[ -d "content/posts/unpublished" ]] && echo true || echo false)" + + publish: + needs: check-unpublished + if: ${{needs.check-unpublished.outputs.should-publish}} + steps: + - run: echo "run" \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index db5a05b7..00000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Publish content before merging - -on: - pull_request: - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - - run: npm ci - - run: npm run build:utils - - run: npm run posts:publish - diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index c61c6f5e..ef5ad51f 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,6 +4,8 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: + + # to be changed to prod branches: ['main'] # Allows you to run this workflow manually from the Actions tab