Update main.yml #6
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: AWS Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout source code. | |
uses: actions/checkout@v2 | |
- name: Check Node v | |
run: node -v | |
- name: Create env file | |
run: | | |
echo "VITE_BACK_URL=${{ secrets.VITE_BACK_URL }}" >> .env | |
echo "VITE_BASE_URL= ${{ secrets.VITE_BASE_URL }}" >> .env | |
echo "VITE_GOOGLE_CLIENT_ID=${{ secrets.VITE_GOOGLE_CLIENT_ID }}" >> .env | |
echo "VITE_KAKAO_KEY=${{ secrets.VITE_KAKAO_KEY }}" >> .env | |
echo "VITE_KAKAO_REST_API=${{ secrets.VITE_KAKAO_REST_API }}" >> .env | |
echo "VITE_NAVER_CLIENT_ID=${{ secrets.VITE_NAVER_CLIENT_ID }}" >> .env | |
echo "VITE_NAVER_CLIENT_KEY=${{ secrets.VITE_NAVER_CLIENT_KEY }}" >> .env | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
env: | |
CI: "" | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY_ID }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Upload to S3 # Upload build file to S3 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY_ID }} | |
run: | | |
aws s3 sync --region ap-northeast-2 dist s3://${{ secrets.AWS_S3_BUCKET_NAME }} --delete |