forked from 9oormthonUniv-seoultech/PROJECT_TEAM_WEB_FE2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 9oormthonUniv-seoultech#51 from jaeyo03/main
깃허브 액션 복구
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
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,37 @@ | ||
name: Build, Push, and Deploy Docker Image | ||
on: | ||
push: | ||
branches: | ||
- main # main 브랜치에 푸시될 때 트리거 | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# 1. 코드 체크아웃 | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
# 2. node_modules 캐시 설정 (필요할 경우) | ||
- name: Cache node_modules | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.npm # If using npm | ||
# For yarn, use path: ~/.cache/yarn | ||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
# 3. Docker Hub에 로그인 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
# 4. Docker 이미지 빌드 및 푸시 | ||
- name: Build Docker image | ||
run: | | ||
docker build \ | ||
--build-arg VITE_KAKAO_MAP_KEY=${{ secrets.VITE_KAKAO_MAP_KEY }} \ | ||
--build-arg VITE_KAKAO_REST_API_KEY=${{ secrets.VITE_KAKAO_REST_API_KEY }} \ | ||
-t ${{ secrets.DOCKER_USERNAME }}/pocket4cut:v1 . | ||
- name: Push Docker image | ||
run: | | ||
docker push "${{ secrets.DOCKER_USERNAME }}/pocket4cut:v1" |