diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml index c238a05..3418f05 100644 --- a/.github/workflows/webpack.yml +++ b/.github/workflows/webpack.yml @@ -2,22 +2,48 @@ name: NodeJS with Webpack on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 19.x + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 19.x - - name: Build - run: | - npm ci && npm run build + - name: Build + run: | + npm ci && npm run build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + + 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