From a95734408322de35ebeba0a35dbee14d9bd899b2 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 26 Nov 2023 22:26:28 +0100 Subject: [PATCH] AoC Viewer - Create deploy-gh-pages.yml --- .github/workflows/deploy-gh-pages.yml | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/deploy-gh-pages.yml diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml new file mode 100644 index 0000000..8c61371 --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yml @@ -0,0 +1,65 @@ +name: Build AoC Viewer and deploy with GitHub Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "20" + cache: npm + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Install dependencies + working-directory: ./viewer + run: npm ci + - name: Build AoC Viewer HTML + working-directory: ./viewer + run: npm run predeploy + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./viewer/dist/viewer + + # Deploy job + deploy: + # Add a dependency to the build job + needs: build + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action + +