[블로그] 23 봄학기 세미나 1 글 사진 문제 수정 (#35) #25
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: Build and Deploy | |
# Controls when the action will run. | |
on: | |
push: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source codes | |
uses: actions/checkout@v2 | |
- name: Checkout deploy branch | |
uses: actions/checkout@v2 | |
with: | |
ref: deploy | |
path: public | |
- name: Setup node environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Build | |
run: | | |
npm install | |
sudo timedatectl set-timezone Asia/Seoul | |
npm run generate | |
- name: Commit build artifacts | |
run: | | |
cd public | |
git config user.name ${GITHUB_ACTOR} | |
git config user.email ${GITHUB_ACTOR}@users.noreply.github.com | |
git add . | |
git commit -m "Update homepage" | |
- name: Push and deploy | |
run: | | |
cd public | |
repo="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | |
git push ${repo} |