1
1
# yq -y < std-unexploded.yml > workflows/std.yml
2
2
name : STD
3
3
on :
4
- workflow_dispatch :
5
- inputs :
6
- deploy :
7
- description : Deploy to dev-preview
8
- type : boolean
9
- required : true
10
- default : false
11
4
workflow_call :
12
5
pull_request :
13
6
branches :
@@ -71,32 +64,35 @@ jobs:
71
64
${{ steps.discovery.outputs.hits }}
72
65
VERY_UNLIKELY_DELIMITER
73
66
echo ==============================================
74
- exit 77
75
67
76
68
77
69
images :
78
70
name : ${{ matrix.target.jobName }}
79
71
runs-on : ubuntu-latest
80
72
needs : discover
81
- if : fromJSON(needs.discover.outputs.hits).oci-images.publish != '{}'
82
73
strategy :
83
74
matrix :
84
- target : ${{ fromJSON(needs.discover.outputs.hits). oci-images.publish }}
75
+ target : ${{ contains( fromJSON(needs.discover.outputs.hits), 'oci-images') && fromJSON(needs.discover.outputs.hits). oci-images.publish || fromJSON('["dummy-target"]') }}
85
76
steps :
86
77
- name : Configure AWS Credentials
78
+ if : matrix.target != 'dummy-target'
87
79
uses :
aws-actions/[email protected]
88
80
with :
89
81
role-to-assume : ${{ env.AWS_ROLE_ARN }}
90
82
aws-region : ${{ env.AWS_REGION }}
91
83
- name : Login to Amazon ECR
84
+ if : matrix.target != 'dummy-target'
92
85
id : login-ecr
93
86
uses : aws-actions/amazon-ecr-login@v1
94
87
- uses : nixbuild/nix-quick-install-action@v25
88
+ if : matrix.target != 'dummy-target'
95
89
- uses : nixbuild/nixbuild-action@v17
90
+ if : matrix.target != 'dummy-target'
96
91
with :
97
92
nixbuild_ssh_key : ${{ secrets.SSH_PRIVATE_KEY }}
98
93
generate_summary_for : job
99
94
- uses : divnix/std-action/setup-discovery-ssh@main
95
+ if : matrix.target != 'dummy-target'
100
96
with :
101
97
ssh_key : ${{ secrets.SSH_PRIVATE_KEY }}
102
98
user_name : ${{ env.DISCOVERY_USER_NAME }}
@@ -106,16 +102,18 @@ jobs:
106
102
run : |
107
103
echo commit: ${{ github.sha }}
108
104
- uses : divnix/std-action/run@main
105
+ if : matrix.target != 'dummy-target'
109
106
with : {ffBuildInstructions: true, remoteStore: "ssh-ng://eu.nixbuild.net"}
110
107
111
108
# ## FIXME:
112
- # ## FIXME: change all instances of `dev-preview` in `diff-to-us` back to `${{ github.ref_name }}`
109
+ # ## FIXME: change all instances of `dev-preview` in `diff-to-us` back to a proper expression;
110
+ # ## FIXME: remove all mentions of `chore/LW-9879-lace-ops-to-sdk`
113
111
# ## FIXME:
114
112
115
113
diff-to-us :
116
114
needs : images
117
115
name : Comment with a Plan Diff (${{ github.ref_name }})
118
- if : github.event_name == 'pull_request' && (github.ref_name == 'dev-preview' || github.ref_name == 'chore/LW-9879-lace-ops-to-sdk')
116
+ if : github.event_name == 'pull_request' && (github.base_ref == 'dev-preview' || github.head_ref == 'chore/LW-9879-lace-ops-to-sdk')
119
117
runs-on : ubuntu-22.04
120
118
steps :
121
119
- uses : actions/checkout@v4
@@ -152,9 +150,8 @@ jobs:
152
150
153
151
154
152
deploy-to-us :
155
- if : github.ref_name == 'dev-preview'
156
- # TODO: if: github.ref_name == 'dev-preview' || github.ref_name == 'chore/LW-9879-lace-ops-to-sdk'
157
- needs : [images, diff-to-us]
153
+ if : github.event_name == 'push' && github.ref_name == 'dev-preview'
154
+ needs : [images]
158
155
concurrency :
159
156
# Only one deployment at a time per environment, and wait for the previous one to finish:
160
157
group : deploy-${{ github.ref_name }}
0 commit comments