@@ -2,9 +2,9 @@ name: Deploy
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - future
7
- - main
5
+ branches : ["main", "future"]
6
+ pull_request :
7
+ branches : [" main", "future"]
8
8
schedule :
9
9
- cron : ' 20 8 * * 1'
10
10
@@ -31,22 +31,24 @@ jobs:
31
31
32
32
- name : Configure AWS credentials
33
33
uses : aws-actions/configure-aws-credentials@v4
34
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
34
35
with :
35
36
aws-region : ${{ env.AWS_REGION }}
36
37
role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
37
38
role-duration-seconds : 900
38
39
39
40
- name : Install latest AWS CLI
40
- id : install-aws-cli
41
41
uses : unfor19/install-aws-cli-action@v1
42
42
43
43
- name : Login to Amazon ECR
44
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
44
45
run : aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${REPOSITORY_PATH}
45
46
env :
46
47
REPOSITORY_PATH : ${{ secrets.PUBLIC_RUNNER_ANSIBLE_ECR_REPOSITORY_URL }}
47
48
48
49
- name : Log in to GitHub registry
49
50
uses : docker/login-action@v3
51
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
50
52
with :
51
53
registry : ghcr.io
52
54
username : ${{ github.actor }}
@@ -80,16 +82,17 @@ jobs:
80
82
81
83
- name : Configure AWS credentials
82
84
uses : aws-actions/configure-aws-credentials@v4
85
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
83
86
with :
84
87
aws-region : ${{ env.AWS_REGION }}
85
88
role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
86
89
role-duration-seconds : 900
87
90
88
91
- name : Install latest AWS CLI
89
- id : install-aws-cli
90
92
uses : unfor19/install-aws-cli-action@v1
91
93
92
94
- name : Login to Amazon ECR
95
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
93
96
run : aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${REPOSITORY_PATH}
94
97
env :
95
98
REPOSITORY_PATH : ${{ secrets.PUBLIC_RUNNER_ANSIBLE_ECR_REPOSITORY_URL_AWS }}
@@ -123,16 +126,17 @@ jobs:
123
126
124
127
- name : Configure AWS credentials
125
128
uses : aws-actions/configure-aws-credentials@v4
129
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
126
130
with :
127
131
aws-region : ${{ env.AWS_REGION }}
128
132
role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
129
133
role-duration-seconds : 900
130
134
131
135
- name : Install latest AWS CLI
132
- id : install-aws-cli
133
136
uses : unfor19/install-aws-cli-action@v1
134
137
135
138
- name : Login to Amazon ECR
139
+ if : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/future' }}
136
140
run : aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin ${REPOSITORY_PATH}
137
141
env :
138
142
REPOSITORY_PATH : ${{ secrets.PUBLIC_RUNNER_ANSIBLE_ECR_REPOSITORY_URL_GCP }}
0 commit comments