From 93ff38904d9260a169fb62c22e2b4a990c36c551 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Sat, 20 Jan 2024 13:28:35 +0000 Subject: [PATCH] feat: seperate deploy and build --- .github/workflows/build.yml | 26 ++++---------------------- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eef0140..46e9dc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,13 @@ -name: 🏗️ Build +name: build +run-name: 🚀 Build on: push: branches: - main - - release/** + pull_request: branches: - main - - release/** permissions: contents: write @@ -17,6 +17,7 @@ concurrency: jobs: build: + name: 🚀 Build runs-on: ubuntu-latest steps: - name: 🛎️ Checkout @@ -36,22 +37,3 @@ jobs: with: name: "build-artifact-${{ github.sha }}" path: build - - deploy: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: 🛎️ Checkout - uses: actions/checkout@v3 - - - name: 📦 Download Build Artifact - uses: actions/download-artifact@v2 - with: - name: "build-artifact-${{ github.sha }}" - path: build - - - name: 🔺 Publish our Build Artifacts - uses: actions/upload-pages-artifact@v2 - with: - name: github-pages - path: build \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..b341e42 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: deploy +run-name: 🚀 Deploy +on: + workflow_run: + workflows: ["build"] + branches: ["main"] + types: + - completed + +permissions: + contents: write + +jobs: + deploy: + name: 🚀 Deploy + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: 🛎️ Checkout + uses: actions/checkout@v3 + + - name: 📦 Download Build Artifact + uses: actions/download-artifact@v2 + with: + name: "build-artifact-${{ github.sha }}" + path: build + + - name: 🔺 Publish our Build Artifacts + uses: actions/upload-pages-artifact@v2 + with: + name: github-pages + path: build \ No newline at end of file