Skip to content

Commit 4161018

Browse files
committed
ci: fix the condition for images
1 parent 2ba1053 commit 4161018

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

.github/workflows/std.yml

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# yq -y < std-unexploded.yml > workflows/std.yml
22
name: STD
33
on:
4-
workflow_dispatch:
5-
inputs:
6-
deploy:
7-
description: Deploy to dev-preview
8-
type: boolean
9-
required: true
10-
default: false
114
workflow_call:
125
pull_request:
136
branches:
@@ -71,32 +64,35 @@ jobs:
7164
${{ steps.discovery.outputs.hits }}
7265
VERY_UNLIKELY_DELIMITER
7366
echo ==============================================
74-
exit 77
7567
7668
7769
images:
7870
name: ${{ matrix.target.jobName }}
7971
runs-on: ubuntu-latest
8072
needs: discover
81-
if: fromJSON(needs.discover.outputs.hits).oci-images.publish != '{}'
8273
strategy:
8374
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"]') }}
8576
steps:
8677
- name: Configure AWS Credentials
78+
if: matrix.target != 'dummy-target'
8779
uses: aws-actions/[email protected]
8880
with:
8981
role-to-assume: ${{ env.AWS_ROLE_ARN }}
9082
aws-region: ${{ env.AWS_REGION }}
9183
- name: Login to Amazon ECR
84+
if: matrix.target != 'dummy-target'
9285
id: login-ecr
9386
uses: aws-actions/amazon-ecr-login@v1
9487
- uses: nixbuild/nix-quick-install-action@v25
88+
if: matrix.target != 'dummy-target'
9589
- uses: nixbuild/nixbuild-action@v17
90+
if: matrix.target != 'dummy-target'
9691
with:
9792
nixbuild_ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
9893
generate_summary_for: job
9994
- uses: divnix/std-action/setup-discovery-ssh@main
95+
if: matrix.target != 'dummy-target'
10096
with:
10197
ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
10298
user_name: ${{ env.DISCOVERY_USER_NAME }}
@@ -106,16 +102,18 @@ jobs:
106102
run: |
107103
echo commit: ${{ github.sha }}
108104
- uses: divnix/std-action/run@main
105+
if: matrix.target != 'dummy-target'
109106
with: {ffBuildInstructions: true, remoteStore: "ssh-ng://eu.nixbuild.net"}
110107

111108
### 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`
113111
### FIXME:
114112

115113
diff-to-us:
116114
needs: images
117115
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')
119117
runs-on: ubuntu-22.04
120118
steps:
121119
- uses: actions/checkout@v4
@@ -152,9 +150,8 @@ jobs:
152150
153151
154152
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]
158155
concurrency:
159156
# Only one deployment at a time per environment, and wait for the previous one to finish:
160157
group: deploy-${{ github.ref_name }}

0 commit comments

Comments
 (0)