From 5d5d583881f25c0777d4bd3d469b8274df595bc3 Mon Sep 17 00:00:00 2001 From: Romana Gruber <65296029+anamone26@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:28:48 +0200 Subject: [PATCH 1/4] Create build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..ecf3326 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,32 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build -- --base-href /gh-pages-workflow/ From 92fb383beac9bfb44a514f94c9ee09c56435c646 Mon Sep 17 00:00:00 2001 From: Romana Gruber <65296029+anamone26@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:39:13 +0200 Subject: [PATCH 2/4] Update build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ecf3326..8b586fa 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -15,7 +15,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" + + # Build job build: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -29,4 +30,22 @@ jobs: run: npm install - name: Build project - run: npm run build -- --base-href /gh-pages-workflow/ + run: npm run build -- --base-href /spcd3/ + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "dist/example/" + + +# Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 124a53488534802d26a09116ef5a23eaf522a8cc Mon Sep 17 00:00:00 2001 From: Romana Gruber <65296029+anamone26@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:43:06 +0200 Subject: [PATCH 3/4] Update build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 8b586fa..6e7bc81 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -45,6 +45,9 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build + permissions: + pages: write + id-token: write steps: - name: Deploy to GitHub Pages id: deployment From 3ef58ec7dcc4ef44d32e6eb83b785e058d69dcf5 Mon Sep 17 00:00:00 2001 From: Romana Gruber <65296029+anamone26@users.noreply.github.com> Date: Tue, 1 Oct 2024 22:14:40 +0200 Subject: [PATCH 4/4] Update build-and-deploy.yml --- .github/workflows/build-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 6e7bc81..fe8d096 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main" ] + branches: [ "gh-pages" ] pull_request: - branches: [ "main" ] + branches: [ "gh-pages" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: