Skip to content

Commit

Permalink
feat: build and push docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Jul 26, 2021
1 parent 9a034bb commit 7c6cec7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
with:
project_id: get-release-xyz
service_account_key: ${{ secrets.GCLOUD_AUTH }}
# if: steps.semrel.outputs.version != ''
- run: gcloud auth configure-docker eu.gcr.io -q
# if: steps.semrel.outputs.version != ''
if: steps.semrel.outputs.version != ''
- run: gcloud auth configure-docker gcr.io -q
if: steps.semrel.outputs.version != ''
- run: ./scripts/docker-build-and-push.sh ${{ steps.semrel.outputs.version }}
if: steps.semrel.outputs.version != ''
20 changes: 20 additions & 0 deletions scripts/docker-build-and-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail

if [ -z "${1:-}" ]; then
echo "version not set"
exit 1
fi

version=$1
image_name="gcr.io/get-release-xyz/get-release-server"
image_name_version="$image_name:$version"

echo "building image..."
docker build -t $image_name_version .

echo "pushing image..."
docker tag $image_name_version $image_name
docker push $image_name_version
docker push $image_name

0 comments on commit 7c6cec7

Please sign in to comment.