diff --git a/.github/workflows/gh-deployment.yml b/.github/workflows/gh-deployment.yml new file mode 100644 index 0000000..21b2f55 --- /dev/null +++ b/.github/workflows/gh-deployment.yml @@ -0,0 +1,39 @@ +name: Deployment to GitHub Pages + +permissions: + contents: write + +on: + # call this workflow when the workflow Main Validation is completed after a push to main + workflow_run: + workflows: + - 'Continuous Integration' + branches: + - main + types: + - completed + +jobs: + deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Begin CI... + uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: .node-version + + - name: Install dependencies + run: npm install + + - name: Build page + run: npm run build + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist