|
1 | | -# This workflow uses actions that are not certified by GitHub. |
2 | | -# They are provided by a third-party and are governed by |
3 | | -# separate terms of service, privacy policy, and support |
4 | | -# documentation. |
5 | | -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time |
6 | | -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle |
7 | | - |
8 | 1 | name: test-deploy |
9 | 2 |
|
10 | 3 | on: |
11 | 4 | push: |
12 | | - branches: [ dev ] |
| 5 | + branches: [ dev, 1151-feature-42api-모니터링스레드에작업 ] |
13 | 6 | workflow_dispatch: |
14 | 7 |
|
15 | | -env: |
16 | | - DOCKER_USER: ${{ secrets.DOCKER_USER }} |
17 | | - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
18 | | - IMAGE_NAME: wken5577/test-migrate-server |
19 | | - |
20 | 8 | permissions: |
21 | 9 | contents: read |
22 | 10 |
|
|
41 | 29 | echo "${{ secrets.MIGRATE_APPLICATION_YML }}" | base64 -d > application.yml |
42 | 30 | shell: bash |
43 | 31 |
|
44 | | - - name: Login to Docker Hub |
45 | | - uses: docker/login-action@v1 |
46 | | - with: |
47 | | - username: ${{ env.DOCKER_USER }} |
48 | | - password: ${{ env.DOCKER_PASSWORD }} |
49 | | - |
50 | 32 | - name: Test with Gradle |
51 | 33 | run: ./gradlew clean test |
52 | 34 |
|
53 | 35 | - name: Build with Gradle |
54 | 36 | run: ./gradlew clean build -x test |
55 | | - |
56 | | - - name: build new docker image as latest tag |
57 | | - run: | |
58 | | - docker build -t ${{ env.IMAGE_NAME }}:latest . |
59 | | - docker push ${{ env.IMAGE_NAME }}:latest |
60 | | -
|
61 | | - - name: Create the configuration file |
62 | | - run: | |
63 | | - cat << EOF > config.json |
64 | | - { |
65 | | - "AutoScalingGroupName": "gg-dev", |
66 | | - "DesiredConfiguration": { |
67 | | - "LaunchTemplate": { |
68 | | - "LaunchTemplateId": "${{ secrets.DEV_LAUNCH_TEMPLATE_ID }}", |
69 | | - "Version": "\$Latest" |
70 | | - } |
71 | | - }, |
72 | | - "Preferences": { |
73 | | - "MinHealthyPercentage": 100, |
74 | | - "MaxHealthyPercentage": 110, |
75 | | - "InstanceWarmup": 300, |
76 | | - "ScaleInProtectedInstances": "Ignore", |
77 | | - "StandbyInstances": "Ignore" |
78 | | - } |
79 | | - } |
80 | | - EOF |
81 | | - cat config.json |
82 | | -
|
83 | | - - name: Configure AWS CLI |
84 | | - uses: aws-actions/configure-aws-credentials@v2 |
85 | | - with: |
86 | | - aws-access-key-id: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_ACCESS_KEY_ID }} |
87 | | - aws-secret-access-key: ${{ secrets.AWS_TEST_MIGRATE_SECURITY_SECRET_KEY }} |
88 | | - aws-region: ap-northeast-2 |
89 | | - |
90 | | - - name: Trigger Instance Refresh |
91 | | - run: | |
92 | | - aws autoscaling start-instance-refresh --cli-input-json file://config.json |
0 commit comments