Skip to content

Commit

Permalink
[main]feat: 푸쉬후 자동 배포
Browse files Browse the repository at this point in the history
  • Loading branch information
seroak committed Sep 10, 2024
1 parent c441cea commit 2f6b32e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
name: Build React App
name: Build React App and Deploy
on:
push:
branches:
- main
jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Create env file
run: |
touch .env
echo REACT_APP_API_ENDPOINT=${{ secrets.REACT_APP_API_ENDPOINT }} >> .env
cat .env
node-version: "20.x"
- name: Npm Install
run: |
npm install
run: npm install
- name: Npm Build
run: |
npm run build
run: npm run build
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --delete
args: --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_STAGING_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
SOURCE_DIR: "dist"
- name: Invalidate CloudFront
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_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
2 changes: 1 addition & 1 deletion src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Home = () => {
return (
<>
{loggedInUserName === "" ? <PublicHeader /> : <LoggedInHeader />}
<h1>깃허브 엑션 ci/cd 됐냐? s3퍼블릭으로 변경</h1>
<h1>푸쉬후 자동 배포 되나?</h1>
</>
);
};
Expand Down

0 comments on commit 2f6b32e

Please sign in to comment.