Skip to content

Commit

Permalink
Merge pull request #7 from opensource-construction/feature/fix-pipeli…
Browse files Browse the repository at this point in the history
…ne-empty

Fix pipeline by storing artifact
  • Loading branch information
Curiosit authored Feb 13, 2024
2 parents 9bd77b4 + 218bec0 commit 0065df4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
on:
workflow_call:
inputs:
store-artifact:
description: 'Whether the built artifact should be stored'
default: false
required: false
type: boolean
artifact-name:
description: 'Name of the artifact, defaults to `built-app`'
default: built-app
required: false
type: string

jobs:
build:
Expand All @@ -14,4 +25,11 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build app
run: npm run build
run: npm run build
- name: Archive build artifacts
if: ${{ inputs.store-artifact }}
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.artifact-name }}
path: ./build
retention-days: 3 # we only store these for 3 days because they're almost always immediately used
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ on:
push:
branches:
- main

jobs:
build:
name: Check Build
uses: ./.github/workflows/build.yml
with:
store-artifact: true
artifact-name: built-app

deploy:
permissions:
Expand All @@ -17,6 +21,11 @@ jobs:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: built-app
path: ./build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down

0 comments on commit 0065df4

Please sign in to comment.