mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
use alternate path for getting digest
This commit is contained in:
parent
1bcb571205
commit
181df2df40
1 changed files with 13 additions and 2 deletions
15
.github/workflows/deploy.yml
vendored
15
.github/workflows/deploy.yml
vendored
|
@ -34,6 +34,13 @@ jobs:
|
|||
with:
|
||||
install: true
|
||||
|
||||
- name: Set up Cloud SDK
|
||||
uses: google-github-actions/setup-gcloud@master
|
||||
with:
|
||||
project_id: ${{ secrets.GCS_PROJECT_ID }}
|
||||
service_account_key: ${{ secrets.GCS_TF_KEY }}
|
||||
export_default_credentials: true
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
|
@ -70,6 +77,10 @@ jobs:
|
|||
docker push $2
|
||||
}
|
||||
|
||||
get_digest() {
|
||||
gcloud artifacts tags list --package=$1 --project=roleypoly --location=us --repository=roleypoly --format=json --filter=${{github.event.inputs.environment}} | jq -r .[].version | sed 's/^.*sha256/sha256/'
|
||||
}
|
||||
|
||||
UI_IMAGE_SRC=ghcr.io/roleypoly/ui${{github.event.inputs.ui_tag}}
|
||||
UI_IMAGE_DEST_BASE=docker.pkg.dev/roleypoly/roleypoly/ui:${{github.event.inputs.environment}}
|
||||
|
||||
|
@ -77,14 +88,14 @@ jobs:
|
|||
retag_push $UI_IMAGE_SRC us-$UI_IMAGE_DEST_BASE
|
||||
retag_push $UI_IMAGE_SRC europe-$UI_IMAGE_DEST_BASE
|
||||
retag_push $UI_IMAGE_SRC asia-$UI_IMAGE_DEST_BASE
|
||||
echo ::set-output name=ui_tag::@$(docker inspect $UI_IMAGE_SRC -f '{{.Id}}')
|
||||
echo ::set-output name=ui_tag::@$(get_digest ui)
|
||||
|
||||
BOT_IMAGE_SRC=ghcr.io/roleypoly/bot${{github.event.inputs.bot_tag}}
|
||||
BOT_IMAGE_DEST_BASE=docker.pkg.dev/roleypoly/roleypoly/bot:${{github.event.inputs.environment}}
|
||||
|
||||
docker pull $BOT_IMAGE_SRC
|
||||
retag_push $BOT_IMAGE_SRC us-$BOT_IMAGE_DEST_BASE
|
||||
echo ::set-output name=bot_tag::@$(docker inspect $BOT_IMAGE_SRC -f '{{.Id}}')
|
||||
echo ::set-output name=ui_tag::@$(get_digest bot)
|
||||
|
||||
deploy_terraform:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
Loading…
Add table
Reference in a new issue