Merge pull request #15 from SW-Palindrome/feature/refresh-token #24
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: React CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
react-cicd: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Lint | |
run: npx eslint src/ | |
- name: Build React App | |
run: npm run build | |
- name: Deploy to S3 | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.IAM_S3_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.IAM_S3_ACCESS_PWD }} | |
aws-region: ap-northeast-2 | |
- name: Upload /build to S3 | |
env: | |
BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME}} | |
run: | | |
aws s3 cp --recursive --region ap-northeast-2 build s3://$BUCKET_NAME |