Skip to content

Commit

Permalink
add continuous integration using github action
Browse files Browse the repository at this point in the history
  • Loading branch information
kw-lee committed Dec 22, 2023
1 parent 2a54811 commit ffe7c8a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: write

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x ]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm i
- run: npm run build
- name: Deploy to GitHub Pages
if: success() && github.ref == 'refs/heads/main'
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: public
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ffe7c8a

Please sign in to comment.