Chore: 브라우저 캐시 새로고침하도록 설정 #4
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: production CI/CD | |
on: | |
push: | |
branches: | |
- main # main 브랜치에 push 시 workflow 실행 | |
jobs: | |
production: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch # 레포지토리 소스를 runner로 가져오기 | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" # Node.js 버전 | |
- name: Export environment variables # GitHub Secrets에서 환경 변수 설정 | |
run: | | |
echo "VITE_API_KEY=${{ secrets.VITE_API_KEY }}" >> $GITHUB_ENV | |
echo "VITE_AUTH_DOMAIN=${{ secrets.VITE_AUTH_DOMAIN }}" >> $GITHUB_ENV | |
echo "VITE_PROJECT_ID=${{ secrets.VITE_PROJECT_ID }}" >> $GITHUB_ENV | |
echo "VITE_STORAGE_BUCKET=${{ secrets.VITE_STORAGE_BUCKET }}" >> $GITHUB_ENV | |
echo "VITE_MESSAGING_SENDER_ID=${{ secrets.VITE_MESSAGING_SENDER_ID }}" >> $GITHUB_ENV | |
echo "VITE_APP_ID=${{ secrets.VITE_APP_ID }}" >> $GITHUB_ENV | |
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> $GITHUB_ENV | |
- name: Build | |
run: yarn && yarn build | |
- name: Deploy to Firebase Hosting production channel | |
id: firebase_hosting_production | |
uses: FirebaseExtended/action-hosting-deploy@v0 # firebase 배포를 위한 action | |
with: | |
repoToken: "${{ secrets.EASY_TICKET }}" # github token | |
firebaseServiceAccount: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" # firebase service account | |
channelId: live # 프로덕션 배포 | |
projectId: easy-ticket-e7da7 # FireBase 프로젝트 ID | |
- name: Check outputs | |
run: | | |
echo urls ${{steps.firebase_hosting_production.outputs.url}} | |
echo expire_time ${{steps.firebase_hosting_production.outputs.expire_time}} | |
echo details_url ${{steps.firebase_hosting_production.outputs.details_url}} |