Merge pull request #45 from SamiJohannes/update-workflow-deploy #4
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 React App to GitHub Pages | |
on: | |
push: | |
branches: | |
- workflow-deploy # Deploy only when pushing to the workflow-deploy branch | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' # Specify the Node.js version | |
# Step 3: Install dependencies | |
- name: Install Dependencies | |
run: npm install | |
# Step 4: Build the React app | |
- name: Build React App | |
run: npm run build | |
# Step 5: Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
run: npm run deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |