Skip to content

Create appspec.yml

Create appspec.yml #9

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Check Node v
run: node -v
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
production-deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Check Node v
run: node -v
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Generate Environment Variables File for Production
run: |
echo "REACT_APP_BASE_URL=$REACT_APP_BASE_URL" >> .env.production
echo "REACT_APP_API_URL=$REACT_APP_API_URL" >> .env.production
env:
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
REACT_APP_API_URL: ${{ secrets.REACT_APP_API_URL }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Deploy to production
run: |
aws s3 cp --recursive --region ap-northeast-2 build s3://${{ secrets.AWS_S3_BUCKET_NAME}}