-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/parkchamchi/GlossySnake
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'src/backend/gs_index/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the project | ||
run: npm run build | ||
|
||
- name: Deploy to GitHub Pages | ||
if: success() | ||
run: | | ||
# Configure git | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
# Clone the gh-pages branch | ||
git clone --branch=gh-pages https://github.com/${{ github.repository }} gh-pages | ||
cd gh-pages | ||
# Copy the built files to the gh-pages branch | ||
cp -r ../dist/gs_index/index.html ./ | ||
cp -r ../dist/gs_index/favicon.ico ./ | ||
rm -rf ./GlossySnake/static/* | ||
cp -r ../dist/gs_index/GlossySnake/static/* ./GlossySnake/static/ | ||
# Commit and push the changes | ||
git add . | ||
git commit -m "Update GitHub Pages with the latest build from master" | ||
git push origin gh-pages |