-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 snutt-map-webview dev 배포 설정 (#108)
- Loading branch information
Showing
5 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/deploy-friends-dev.yml → ...flows/deploy-friends-react-native-dev.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: deploy-dev | ||
name: deploy-friends-react-native-dev | ||
|
||
on: | ||
push: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/deploy-friends-prod.yml → ...lows/deploy-friends-react-native-prod.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: deploy-prod | ||
name: deploy-friends-react-native-prod | ||
|
||
on: | ||
push: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: deploy-map-webview-dev | ||
|
||
on: | ||
push: | ||
tags: | ||
- map-webview-dev-* | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: apps/map-webview | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Build & Export | ||
run: | | ||
yarn install | ||
yarn build | ||
- name: Deploy to S3 and Invalidate Cloudfront | ||
id: deploy-s3 | ||
env: | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET_SNUTT_MAP_WEBVIEW_DEV }} | ||
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_SNUTT_MAP_WEBVIEW_DEV }} | ||
run: | | ||
aws s3 sync ./dist s3://$AWS_S3_BUCKET --delete | ||
aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
env=$1 | ||
|
||
today=$(date +%y.%m.%d) | ||
tagFormat="map-webview-${env}-${today}-" | ||
|
||
git fetch --all --tags | ||
tagCount=$(git tag -l | grep -c $tagFormat) | ||
|
||
newTagNumber=$(($tagCount + 1)) | ||
newTagName="${tagFormat}${newTagNumber}" | ||
|
||
echo | ||
echo "==================================" | ||
echo | ||
echo " Created tag: \033[1m${newTagName}\033[0m " | ||
echo | ||
echo "==================================" | ||
echo | ||
read -p "Are you sure to push this tag? (Y/n) " -n 1 -r | ||
echo | ||
|
||
if [[ $REPLY =~ ^[Yy]$ ]]; then | ||
git tag -a $newTagName -m $newTagName | ||
git push origin $newTagName | ||
else | ||
echo | ||
echo "\033[31mCanceled.\033[0m" | ||
echo | ||
exit 1 | ||
fi |