-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge image builds and add update services workflow
- Loading branch information
1 parent
fbe5894
commit 91be7f3
Showing
4 changed files
with
72 additions
and
147 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Update GCP Docker Services | ||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: ["Build and Push Docker Images"] | ||
branches: [main, automate-docker-update] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
update-gcp-services: | ||
runs-on: ubuntu-latest | ||
needs: build-and-push-to-gcr | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # to get all tags | ||
|
||
- id: "auth" | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: "${{ secrets.JSON_GCLOUD_SERVICE_ACCOUNT_JSON }}" | ||
|
||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v1" | ||
with: | ||
version: ">= 447.0.0" | ||
|
||
- name: "Update API Service" | ||
run: | | ||
gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_api --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-api:${{ github.sha }} | ||
gcloud compute ssh --zone us-central1-a monarch-v3-dev-manager -- sudo docker service update monarch-v3_nginx --with-registry-auth --update-order=start-first --force --image us-central1-docker.pkg.dev/monarch-initiative/monarch-api/monarch-ui:${{ github.sha }} |