Skip to content

Commit 44d49b2

Browse files
committed
Use GITHUB_OUTPUT instead of GITHUB_ENV
1 parent c37ba1f commit 44d49b2

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/update-cache-and-deployment.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ on:
1414
required: true
1515

1616
jobs:
17-
set-github-env:
17+
set-variables:
1818
runs-on: ubuntu-22.04
19+
outputs:
20+
yyyymmddhhmm: ${{ steps.yyyymmddhhmm.outputs.time }}
1921
steps:
2022
- name: Set YYYYMMDDHHMM
21-
run: echo "YYYYMMDDHHMM=$(date -u +'%Y%m%d%H%M')" >> $GITHUB_ENV
23+
id: yyyymmddhhmm
24+
run: echo "time=$(date -u +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
25+
- name: Echo YYYYMMDDHHMM
26+
run: echo ${{ steps.yyyymmddhhmm.outputs.time }}
2227
update-cvd-test-bazel-cache:
2328
if: inputs.update-cache
2429
runs-on: ubuntu-24.04
@@ -38,7 +43,7 @@ jobs:
3843
- name: Run cvd unit tests
3944
uses: ./.github/actions/run-cvd-unit-tests
4045
update-bazel-cache-and-deploy-debian-package-amd64:
41-
needs: [set-github-env]
46+
needs: [set-variables]
4247
environment: deployment
4348
runs-on: ubuntu-22.04
4449
steps:
@@ -57,7 +62,7 @@ jobs:
5762
- name: Build CF host debian packages
5863
uses: ./.github/actions/build-debian-packages
5964
with:
60-
yyyymmddhhmm: ${{ env.YYYYMMDDHHMM }}
65+
yyyymmddhhmm: ${{ needs.set-variables.outputs.yyyymmddhhmm }}
6166
- name: Authentication on GCP project android-cuttlefish-artifacts
6267
if: inputs.deploy-channel != ''
6368
uses: 'google-github-actions/auth@v2'
@@ -70,7 +75,7 @@ jobs:
7075
deploy-channel: ${{ inputs.deploy-channel }}
7176
path: .
7277
update-bazel-cache-and-deploy-debian-package-arm64:
73-
needs: [set-github-env]
78+
needs: [set-variables]
7479
environment: deployment
7580
runs-on: ubuntu-22.04-arm
7681
steps:
@@ -89,7 +94,7 @@ jobs:
8994
- name: Build CF host debian packages
9095
uses: ./.github/actions/build-debian-packages
9196
with:
92-
yyyymmddhhmm: ${{ env.YYYYMMDDHHMM }}
97+
yyyymmddhhmm: ${{ needs.set-variables.outputs.yyyymmddhhmm }}
9398
- name: Authentication on GCP project android-cuttlefish-artifacts
9499
if: inputs.deploy-channel != ''
95100
uses: 'google-github-actions/auth@v2'
@@ -104,7 +109,7 @@ jobs:
104109

105110
deploy-docker-image-amd64:
106111
if: inputs.deploy-channel != ''
107-
needs: [update-bazel-cache-and-deploy-debian-package-amd64]
112+
needs: [set-variables, update-bazel-cache-and-deploy-debian-package-amd64]
108113
environment: deployment
109114
runs-on: ubuntu-22.04
110115
steps:
@@ -127,10 +132,10 @@ jobs:
127132
with:
128133
arch: amd64
129134
deploy-channel: ${{ inputs.deploy-channel }}
130-
yyyymmddhhmm: ${{ env.YYYYMMDDHHMM }}
135+
yyyymmddhhmm: ${{ needs.set-variables.outputs.yyyymmddhhmm }}
131136
deploy-docker-image-arm64:
132137
if: inputs.deploy-channel != ''
133-
needs: [update-bazel-cache-and-deploy-debian-package-arm64]
138+
needs: [set-variables, update-bazel-cache-and-deploy-debian-package-arm64]
134139
environment: deployment
135140
runs-on: ubuntu-22.04-arm
136141
steps:
@@ -153,10 +158,10 @@ jobs:
153158
with:
154159
arch: arm64
155160
deploy-channel: ${{ inputs.deploy-channel }}
156-
yyyymmddhhmm: ${{ env.YYYYMMDDHHMM }}
161+
yyyymmddhhmm: ${{ needs.set-variables.outputs.yyyymmddhhmm }}
157162
deploy-docker-manifest:
158163
if: inputs.deploy-channel != ''
159-
needs: [deploy-docker-image-amd64, deploy-docker-image-arm64]
164+
needs: [set-variables, deploy-docker-image-amd64, deploy-docker-image-arm64]
160165
environment: deployment
161166
runs-on: ubuntu-22.04
162167
steps:
@@ -189,7 +194,7 @@ jobs:
189194
nightly)
190195
# Nightly version tag : gitYYYYMMDDHHMM-<Github SHA 8 digit>
191196
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
192-
TAG="git${{ env.YYYYMMDDHHMM }}-${SHORT_SHA}"
197+
TAG="git${{ needs.set-variables.outputs.yyyymmddhhmm }}-${SHORT_SHA}"
193198
;;
194199
*)
195200
exit 1

0 commit comments

Comments
 (0)