From bfe8326ee8db2b93a0888dc51097ab8ab222f388 Mon Sep 17 00:00:00 2001 From: Auburn Date: Fri, 13 Oct 2023 22:08:14 +0100 Subject: [PATCH] WebPreviewApp actions deploy --- .github/workflows/deploy-web-preview-app.yml | 73 +++++++++++++------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/.github/workflows/deploy-web-preview-app.yml b/.github/workflows/deploy-web-preview-app.yml index 48293ce..b7c50f1 100644 --- a/.github/workflows/deploy-web-preview-app.yml +++ b/.github/workflows/deploy-web-preview-app.yml @@ -1,36 +1,57 @@ -# This is a basic workflow to help you get started with Actions - name: Update WebPreviewApp -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the $default-branch branch + # Runs on pushes targeting the default branch push: - branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] + #branches: ["master"] # 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 +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write - # Steps represent a sequence of tasks that will be executed as part of the job +# 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: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: windows-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + - name: Checkout + uses: actions/checkout@v3 + + - name: Build WebPreviewApp + run: './build.ps1' + working-directory: './WebPreviewApp' + shell: powershell + + - name: Create Pages Directory + run: 'New-Item pagesbuild -ItemType Directory' + shell: powershell + + - name: Copy WebPreviewApp HTML + run: 'Copy-Item ./WebPreviewApp/build/FastNoiseLitePreview.html -Destination ./pagesbuild/' + shell: powershell + + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload pagesbuild dir + path: './pagesbuild' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 +