|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | deploy: |
9 | | - name: Deploy-api-prod-native |
10 | | - runs-on: ubuntu-24.04-arm |
11 | | - env: |
12 | | - IMAGE_TAG: ${{ github.run_number }} |
13 | | - BUILD_NUMBER: ${{ github.run_number }} |
14 | | - ECR_REGISTRY: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com |
15 | | - ECR_REPOSITORY: snutt-prod/snutt-timetable |
| 9 | + uses: ./.github/workflows/_deploy-native.yml |
| 10 | + with: |
| 11 | + ecr_repository: snutt-prod/snutt-timetable |
| 12 | + dockerfile: api/Dockerfile-native |
| 13 | + secrets: |
| 14 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 15 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
16 | 16 |
|
| 17 | + notify: |
| 18 | + needs: deploy |
| 19 | + runs-on: ubuntu-latest |
17 | 20 | steps: |
18 | | - - name: Checkout |
19 | | - uses: actions/checkout@v4 |
20 | | - |
21 | | - - name: Configure AWS credentials |
22 | | - uses: aws-actions/configure-aws-credentials@v4 |
23 | | - with: |
24 | | - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
25 | | - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
26 | | - aws-region: ap-northeast-2 |
27 | | - |
28 | | - - name: Login to ECR |
29 | | - id: login-ecr |
30 | | - uses: aws-actions/amazon-ecr-login@v2 |
31 | | - |
32 | | - - name: Get and save Auth Token for CodeArtifact |
33 | | - id: get-save-codeartifact-auth-token |
34 | | - run: | |
35 | | - aws codeartifact get-authorization-token --domain wafflestudio --domain-owner 405906814034 --query authorizationToken --region ap-northeast-1 --output text > .codeartifact_token |
36 | | -
|
37 | | - - name: Docker build, tag, and push image to ECR |
38 | | - id: build-push-image |
39 | | - run: | |
40 | | - docker build --secret id=codeartifact_token,src=./.codeartifact_token -f api/Dockerfile-native -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . --platform linux/arm64 |
41 | | - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |
42 | | - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" |
| 21 | + - name: Slack Notify |
| 22 | + uses: rtCamp/action-slack-notify@v2.3.3 |
| 23 | + env: |
| 24 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
| 25 | + SLACK_CHANNEL: team-snutt-deploy |
| 26 | + SLACK_TITLE: NEW RELEASE |
| 27 | + SLACK_USERNAME: snutt-timetable |
| 28 | + SLACK_ICON: https://user-images.githubusercontent.com/35535636/103177470-2237cb00-48be-11eb-9211-3ffa567c8ac3.png |
| 29 | + SLACK_MESSAGE: Check <https://argocd.wafflestudio.com|Argo CD> for updated environment |
0 commit comments