Skip to content

Commit f2e5a42

Browse files
committed
Deploy docker manifest of cuttlefish-orchestration image
1 parent f980deb commit f2e5a42

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
path: .
9696

9797
deploy-docker-image-amd64:
98+
if: github.repository_owner == 'google' && github.event_name == 'push'
99+
environment: deployment
98100
runs-on: ubuntu-22.04
99101
steps:
100102
- name: Checkout repository
@@ -116,6 +118,8 @@ jobs:
116118
with:
117119
arch: amd64
118120
deploy-docker-image-arm64:
121+
if: github.repository_owner == 'google' && github.event_name == 'push'
122+
environment: deployment
119123
runs-on: ubuntu-22.04-arm
120124
steps:
121125
- name: Checkout repository
@@ -136,3 +140,40 @@ jobs:
136140
uses: ./.github/actions/deploy-docker-image
137141
with:
138142
arch: arm64
143+
deploy-docker-manifest:
144+
if: github.repository_owner == 'google' && github.event_name == 'push'
145+
environment: deployment
146+
needs: [deploy-docker-image-amd64, deploy-docker-image-arm64]
147+
environment: deployment
148+
runs-on: ubuntu-22.04
149+
steps:
150+
- name: Checkout repository
151+
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
152+
- name: Authentication on GCP project android-cuttlefish-artifacts
153+
uses: 'google-github-actions/auth@v2'
154+
with:
155+
credentials_json: '${{ secrets.ARTIFACT_REGISTRY_UPLOADER }}'
156+
- name: Login to Artifact Registry
157+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # aka v3.5.0
158+
with:
159+
registry: us-docker.pkg.dev
160+
username: _json_key
161+
password: '${{ secrets.ARTIFACT_REGISTRY_UPLOADER }}'
162+
- name: Deploy manifests
163+
run: |
164+
# TODO(b/440196950): Setup condition on this step when we build
165+
# stable/unstable versions here too.
166+
167+
# Stable/Unstable version tag : X.Y.Z
168+
# Nightly version tag : gitYYYYMMDD-<Github SHA 8 digit>
169+
DATE=$(date -u +'%Y%m%d')
170+
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-8)
171+
TAG="git${DATE}-${SHORT_SHA}"
172+
IMAGE=us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration
173+
174+
for MANIFEST_TAG in ${TAG} nightly; do
175+
docker manifest create ${IMAGE}:${MANIFEST_TAG} \
176+
--amend ${IMAGE}:${TAG}-amd64 \
177+
--amend ${IMAGE}:${TAG}-arm64
178+
docker manifest push ${IMAGE}:${MANIFEST_TAG}
179+
done

0 commit comments

Comments
 (0)