diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index c1310ae..68bbd23 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -1,57 +1,35 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages +name: Deploy to 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 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 + branches: + - main jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest + build-and-deploy: + runs-on: ubuntu-22.04 + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 - - name: Set up Node + + - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 20 - cache: 'npm' + node-version: '20' + - name: Install dependencies - run: npm ci - - name: Print environment variables - run: | - echo "GITHUB_ACTIONS: $GITHUB_ACTIONS" - echo "NODE_ENV: $NODE_ENV" - echo "Other environment variables:" - env - - name: Build + run: npm install + + - name: Build the project run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload dist folder - path: './dist' + - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist + publish_branch: gh-pages