Skip to content

ci : env 값 추가 #59

ci : env 값 추가

ci : env 값 추가 #59

Workflow file for this run

name: postamn
on:
push:
branches:
- chore-build-오류-해결-
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.18.0'
- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ./.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install
- name: Build project
run: |
VITE_API_URL=${{ secrets.VITE_API_URL }} \
VITE_FIREBASE_API_KEY=${{ secrets.VITE_FIREBASE_API_KEY }} \
VITE_FIREBASE_AUTH_DOMAIN=${{ secrets.VITE_FIREBASE_AUTH_DOMAIN }} \
VITE_FIREBASE_PROJECT_ID=${{ secrets.VITE_FIREBASE_PROJECT_ID }} \
VITE_FIREBASE_STORAGE_BUCKET=${{ secrets.VITE_FIREBASE_STORAGE_BUCKET }} \
VITE_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.VITE_FIREBASE_MESSAGING_SENDER_ID }} \
VITE_FIREBASE_APP_ID=${{ secrets.VITE_FIREBASE_APP_ID }} \
VITE_FIREBASE_MEASUREMENT_ID=${{ secrets.VITE_FIREBASE_MEASUREMENT_ID }} \
VITE_FCM_VAPID_KEY=${{ secrets.VITE_FCM_VAPID_KEY }} \
yarn build
- name: Deploy to S3
uses: jakejarvis/[email protected]
with:
args: --delete
env:
AWS_S3_BUCKET: devfinal
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2
SOURCE_DIR: dist
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \
--paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2