카테고리toString으로수정 #25
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: deploy_want_k8s | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Cache Gradle Wrapper and JIB Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
/home/runner/.cache/google-cloud-tools-java | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: install kubctl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: 'v1.26.0' | |
id: install | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
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: update cluster information | |
run: aws eks update-kubeconfig --name 5-team-cluster --region ap-northeast-2 | |
- name: login to ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR with Jib | |
run: | | |
./gradlew :jib --image=346903264902.dkr.ecr.ap-northeast-2.amazonaws.com/want:latest | |
- name: kubectl apply | |
run: | | |
kubectl apply -f ./k8s/want_depl.yml | |
kubectl rollout restart deployment want-deployment |