Skip to content

Commit

Permalink
feat: seperate deploy and build
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Jan 20, 2024
1 parent 982d8a1 commit 93ff389
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: πŸ—οΈ Build
name: build
run-name: πŸš€ Build
on:
push:
branches:
- main
- release/**

pull_request:
branches:
- main
- release/**

permissions:
contents: write
Expand All @@ -17,6 +17,7 @@ concurrency:

jobs:
build:
name: πŸš€ Build
runs-on: ubuntu-latest
steps:
- name: πŸ›ŽοΈ Checkout
Expand All @@ -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
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 93ff389

Please sign in to comment.