Skip to content

Commit

Permalink
fix: deployment file upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Jan 20, 2024
1 parent 29f9cd3 commit 8249b83
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,39 @@ run-name: πŸš€ Deploy
on:
workflow_run:
workflows: ["build"]
branches: ["main"]
branches: ["main", "release/*"]
types:
- completed

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



jobs:
deploy:
name: πŸš€ Deploy
# Only run if the build was successful
if: ${{ github.event.workflow_run.conclusion == 'success' }}

name: πŸš€ Deploy
runs-on: ubuntu-latest
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v3
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

- 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
permissions:
pages: write
contents: write
id-token: write

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

- name: Get the URL for the deployment
run: echo "${{ steps.deployment.outputs.page_url }}"

0 comments on commit 8249b83

Please sign in to comment.