From bd3848cdc26caaa8820b7f65873e4a76ecda0eb0 Mon Sep 17 00:00:00 2001 From: Lukas Merz Date: Tue, 13 Feb 2024 07:37:15 +0100 Subject: [PATCH 1/2] Fix pipeline by storing artifact --- .github/workflows/build.yml | 20 +++++++++++++++++++- .github/workflows/deploy.yml | 10 ++++++++++ public/index.html | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddb35c1..e55a08b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -14,4 +25,11 @@ jobs: - name: Install dependencies run: npm ci - name: Build app - run: npm run build \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c7c5824..fb080fc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,10 +4,15 @@ on: push: branches: - main + - feature/fix-pipeline-empty # todo: only for testing + jobs: build: name: Check Build uses: ./.github/workflows/build.yml + with: + store-artifact: true + artifact-name: built-app deploy: permissions: @@ -17,6 +22,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: diff --git a/public/index.html b/public/index.html index d09dc4b..1c2b658 100644 --- a/public/index.html +++ b/public/index.html @@ -27,7 +27,7 @@ Open I - The Simple IFC Clipper - +