Skip to content

Commit

Permalink
Merge pull request #8 from petertonysmith94/fix/only-deploy-on-main
Browse files Browse the repository at this point in the history
Fix/only deploy on main
  • Loading branch information
petertonysmith94 authored Jan 20, 2024
2 parents 936ac3c + 8249b83 commit 08566d9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 22 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: 🏗️ Build
name: build
run-name: 🚀 Build
on:
push:
branches:
- main
- release/**

pull_request:
branches:
- main
Expand All @@ -17,6 +19,7 @@ concurrency:

jobs:
build:
name: 🚀 Build
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
Expand All @@ -32,26 +35,7 @@ jobs:
run: pnpm run build

- name: 📦 Upload Build Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-pages-artifact@v3
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
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: deploy
run-name: 🚀 Deploy
on:
workflow_run:
workflows: ["build"]
branches: ["main", "release/*"]
types:
- completed

env:
DEPLOY_PREVIEW: ${{ github.event.workflow_run.event == 'pull_request' }}
ARTIFACT_NAME: "build-artifact-${{ github.sha }}"



jobs:
deploy:
# Only run if the build was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}

name: 🚀 Deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
contents: write
id-token: write

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: ${{ env.ARTIFACT_NAME}}
preview: ${{ env.DEPLOY_PREVIEW }}

- name: Get the URL for the deployment
run: echo "${{ steps.deployment.outputs.page_url }}"
6 changes: 5 additions & 1 deletion src/pages/sources.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Sources

[Shubham Dhage | 3D Artist](https://unsplash.com/@theshubhamdhage)
[Shubham Dhage | 3D Artist](https://unsplash.com/@theshubhamdhage)

- [./assets/shubham-dhage-pringle-layers.jpg](../assets/shubham-dhage-pringle-layers.jpg)
- [./assets/shubham-dhage-sphere-center.jpg](../assets/shubham-dhage-sphere-center.jpg)
- [./assets/shubham-dhage-sphere-offset-left.jpg](../assets/shubham-dhage-sphere-offset-left.jpg)

0 comments on commit 08566d9

Please sign in to comment.