chore: lighthouse 체크 github actions 추가 #195
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: Gatsby Deploy | |
on: | |
push: | |
branches: main | |
jobs: | |
deployment: | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, 'pozafly/renovate') }} | |
steps: | |
# time zone이 세팅 되지 않으면 배포 시 ReactDOM 관련 Error 발생. | |
# GitHub Actions linux 환경에서 Gatsby 빌드 시 time zone 맞추는 작업 필요. | |
- name: Time Zone Setting | |
run: sudo timedatectl set-timezone Asia/Seoul | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Use cache | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: | | |
**/node_modules | |
**/.cache | |
**/public | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
${{ runner.os }} | |
- name: Dependency install | |
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }} | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Slack noti | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,eventName,workflow,job,took | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: always() | |
- name: GitHub Pages deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
publish_dir: ./public | |
publish_branch: static |