diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f3e61b..c904c36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,25 +1,44 @@ -name: Execute Build +name: Deploy static content to Pages on: push: - branches: - - master + branches: ['main'] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: true + jobs: - build-and-deploy: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - permissions: - contents: write steps: - - uses: actions/checkout@v4 - - name: Use Node.js + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '21.x' + node-version: 21 + cache: 'npm' - name: Install dependencies - run: | - npm ci - npx vite build - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 + run: npm install + - name: Build + run: npx vite build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 with: - folder: dist \ No newline at end of file + path: './dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 8cd7176..7a6e261 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,7 +1,7 @@ module.exports = { root: 'src', build: { - base: 'https://sheldan.github.io/orbits/', + base: '/orbits/', outDir: '../dist' } } \ No newline at end of file