From b6e318d59f79c44c6036a505838d388b4374417c Mon Sep 17 00:00:00 2001 From: Anna <16231288+HumbleDeer@users.noreply.github.com> Date: Fri, 3 Nov 2023 06:43:37 +0100 Subject: [PATCH] Create/config Vite to Pages Action --- .github/workflows/vite-deploy.yml | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/vite-deploy.yml diff --git a/.github/workflows/vite-deploy.yml b/.github/workflows/vite-deploy.yml new file mode 100644 index 0000000..e8e3165 --- /dev/null +++ b/.github/workflows/vite-deploy.yml @@ -0,0 +1,59 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy Vite.js site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ['master'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# 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: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Configure GitHub Pages + uses: actions/configure-pages@v3.0.6 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Vite Build + run: npm run build --base=$VITE_BASE_URL + env: + VITE_BASE_URL: "/website/" + - name: Upload GH Pages artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload dist folder + path: './dist' + + # 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@v2