Skip to content

Commit

Permalink
set default deployment enviornment to dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrouth committed Mar 4, 2024
1 parent ab32917 commit 4e5823f
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,20 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
gcr.io/skyviewer/rubinobs-client,enable=${{ github.ref != 'master' && github.ref_type != 'tag' && github.base_ref == 'develop' }}
gcr.io/edc-int-6c5e/rubinobs-client,enable=${{ github.ref == 'master' || github.base_ref == 'master'}}
gcr.io/edc-prod-eef0/rubinobs-client,enable=${{ github.ref_type == 'tag'}}
flavor: |
latest=${{ github.event_name == 'push'}}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Parse deployment info
id: deploy-info
run: |
# Determine environment to deploy to
if ${{ github.ref != 'master' && github.ref_type != 'tag' && github.base_ref == 'develop' }}; then
environment_name="dev"
credentials_json='${{ secrets.DEV_SA_KEY }}'
elif ${{ github.ref == 'master' || github.base_ref == 'master'}}; then
if ${{ github.ref == 'master' || github.base_ref == 'master'}}; then
environment_name="int"
credentials_json='${{ secrets.SKYVIEWER_INT_SERVICE_ACCOUNT }}'
elif ${{ github.ref_type == 'tag'}}; then
environment_name="prod"
credentials_json='${{ secrets.PIPELINE_EPO_PROD_PROJECT }}'
else
environment_name=""
credentials_json=""
environment_name="dev"
credentials_json='${{ secrets.DEV_SA_KEY }}'
fi
echo environment_name=$environment_name >> "$GITHUB_OUTPUT"
echo credentials_json=$credentials_json >> "$GITHUB_OUTPUT"
Expand All @@ -79,7 +55,27 @@ jobs:
echo image_tag=$(echo "$full_tag" | cut -f2 -d:) >> "$GITHUB_OUTPUT"
echo image_name=$(echo "$full_tag" | cut -f1 -d:) >> "$GITHUB_OUTPUT"
echo full_tag=$full_tag >> "$GITHUB_OUTPUT"
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
gcr.io/skyviewer/rubinobs-client,enable=${{ steps.deploy-info.outputs.environment_name == 'dev' }}
gcr.io/edc-int-6c5e/rubinobs-client,enable=${{ steps.deploy-info.outputs.environment_name == 'int' }}
gcr.io/edc-prod-eef0/rubinobs-client,enable=${{ steps.deploy-info.outputs.environment_name == 'prod' }}
flavor: |
latest=${{ github.event_name == 'push'}}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down

0 comments on commit 4e5823f

Please sign in to comment.