From ff130e031f26e212c4e74ba0f3c4b35d4ee6cc71 Mon Sep 17 00:00:00 2001 From: NilsUeter Date: Thu, 13 Apr 2023 22:07:06 +0200 Subject: [PATCH] Create PagesDeploy --- .github/workflows/PagesDeploy.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/PagesDeploy.yml diff --git a/.github/workflows/PagesDeploy.yml b/.github/workflows/PagesDeploy.yml new file mode 100644 index 0000000..f4fa71b --- /dev/null +++ b/.github/workflows/PagesDeploy.yml @@ -0,0 +1,50 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and deploys to Github Pages + +name: Build with NodeJS & deploy static content to Pages + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Single deploy job to Github Pages + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up NodeJS 19 + uses: actions/setup-node@v3 + with: + node-version: "19" + cache: "npm" + - name: Clean install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload build dir + path: "./dist" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1