Skip to content

Commit

Permalink
cicd: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kodebae committed Aug 26, 2024
1 parent 399b5a6 commit 9b12fab
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy React App
name: Deploy

on:
push:
Expand All @@ -7,27 +7,43 @@ on:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install
uses: bahmutov/npm-install@v1

- name: Build the app
- name: Build project
run: npm run build
env:
GITHUB_PAGES: true

- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
path: ./dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: actions/configure-pages@v3
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist

0 comments on commit 9b12fab

Please sign in to comment.