@@ -167,3 +167,52 @@ jobs:
167167 --amend ${IMAGE}:${VERSION}-arm64
168168 docker manifest push ${IMAGE}:${MANIFEST_TAG}
169169 done
170+
171+ deploy-cuttlefish-cloud-orchestrator-on-premise-config :
172+ needs : [set-variables]
173+ environment : deployment
174+ runs-on : ubuntu-24.04
175+ steps :
176+ - name : Checkout repository
177+ uses : actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2
178+ - name : Authentication on GCP project android-cuttlefish-artifacts
179+ uses : ' google-github-actions/auth@v2'
180+ with :
181+ credentials_json : ' ${{ secrets.artifact-registry-uploader-json-creds }}'
182+ - name : ' Set up Cloud SDK'
183+ uses : ' google-github-actions/setup-gcloud@v3.0.0'
184+ with :
185+ version : ' >= 363.0.0'
186+ - name : Deploy conf.toml
187+ run : |
188+ # Retrieve conf.toml with substituting proper version of docker image.
189+ ORCHESTRATION_IMAGE="us-docker.pkg.dev/android-cuttlefish-artifacts/cuttlefish-orchestration/cuttlefish-orchestration"
190+ ORCHESTRATION_IMAGE_VERSION=$(gcloud artifacts docker tags list ${ORCHESTRATION_IMAGE} \
191+ --filter "tag ~ \".*${{ inputs.deploy-channel }}\$\"" \
192+ --format json \
193+ | jq '.[0].version'
194+ )
195+ ORCHESTRATION_TAG=$(gcloud artifacts docker tags list ${ORCHESTRATION_IMAGE} \
196+ --filter "(version=${ORCHESTRATION_IMAGE_VERSION}) AND NOT (tag ~ \".*${{ inputs.deploy-channel }}\$\" OR tag ~ \".*latest\$\")" \
197+ --format json \
198+ | jq -r '.[0].tag | split("/") | last'
199+ )
200+ wget -O conf.toml "https://raw.githubusercontent.com/google/cloud-android-orchestration/${{ github.sha }}/scripts/on-premises/single-server/conf.toml"
201+ sed -i "s|DockerImageName = .*|DockerImageName = \"${ORCHESTRATION_IMAGE}:${ORCHESTRATION_TAG}\"|g" conf.toml
202+
203+ # Update conf.toml on Artifact Registry
204+ gcloud artifacts versions delete ${{ inputs.deploy-channel }} \
205+ --location="us" \
206+ --package="on-premise-single-server" \
207+ --project="android-cuttlefish-artifacts" \
208+ --quiet \
209+ --repository="cloud-orchestrator-config"
210+ for VERSION in ${{ needs.set-variables.outputs.version }} ${{ inputs.deploy-channel }}; do
211+ gcloud artifacts generic upload \
212+ --location="us" \
213+ --package="on-premise-single-server" \
214+ --project="android-cuttlefish-artifacts" \
215+ --repository="cloud-orchestrator-config" \
216+ --source="conf.toml" \
217+ --version="${VERSION}"
218+ done
0 commit comments