Merge pull request #36 from SteinCodeAT/dev-te #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Production | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
# Build the final app | |
build: | |
# Add a dependency to the build job | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- run: npm install | |
- run: npm run build | |
- name: Upload artifact to enable deployment | |
uses: actions/upload-artifact@v4 | |
with: | |
name: production-files | |
path: ./dist | |
overwrite: true | |
# Deploy the app | |
deploy: | |
# Add a dependency to the build job | |
needs: build | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: production-files | |
path: ./dist | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist |