From 978fb23ad9abbeb18b8b223cd18399409e8bde76 Mon Sep 17 00:00:00 2001 From: gaudinnicolas Date: Sun, 2 Jun 2024 11:18:44 +0200 Subject: [PATCH] ci: separate PR (build only) and Push (build and deploy) --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e377cc29 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ + +name: 🦕 Build D4G Docusaurus website on Pull Request + +on: + # Triggers the workflow on Pull Request events but only for the default branch + pull_request: + branches: + - master + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + name: Build Docusaurus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies and build website + run: | + yarn install --frozen-lockfile + yarn build + diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 590b996a..cef99086 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,12 +2,14 @@ name: 🦕 Build and Deploy D4G Docusaurus website to GitHub Pages on: + # Triggers the workflow on push events but only for the default branch push: branches: - master - # Review gh actions docs if you want to further define triggers, paths, etc - # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + jobs: build: name: Build Docusaurus