-
Notifications
You must be signed in to change notification settings - Fork 321
49 lines (42 loc) · 1.21 KB
/
down-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Bring Down Service
run-name: Bringing ${{ inputs.service }} down
# Required for IDP JWT and actions/checkout
permissions:
id-token: write
contents: read
on:
workflow_call:
inputs:
environment:
type: string
required: true
description: "where to deploy"
service:
type: string
required: true
description: "service to deploy"
jobs:
down:
environment: ${{ inputs.environment }}
name: ${{ inputs.service }} Down
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ASSUME_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Checkout code
uses: actions/checkout@v4
- name: Down service
run: |
component/toolbox/awsi.sh service-state -p pull-from-env -r us-east-1 -a y -s ${{ inputs.service }} -S down
on-failure:
uses: ./.github/workflows/instance-refresh.yml
needs: down
if: failure()
with:
environment: ${{ inputs.environment }}
service: ${{ inputs.service }}
secrets: inherit