Skip to content

Commit

Permalink
configure enviroment and job concurrency group
Browse files Browse the repository at this point in the history
Signed-off-by: Otieno Calvine <nyarangaotieno@gmail.com>
  • Loading branch information
NYARAS committed Aug 17, 2021
1 parent b61bd54 commit 235e387
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/deployment.yaml
Expand Up @@ -2,10 +2,14 @@ name: Deployment

on: [push]

concurrency:
group: build_and_push_image

jobs:
build_and_push_image:
runs-on: ubuntu-latest
environment:
name: test # run this only in test environment for now
steps:
- uses: actions/checkout@v2

Expand All @@ -22,22 +26,22 @@ jobs:
# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@master
with:
service_account_key: ${{ secrets.GCLOUD_SERVICE_KEY }}
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
export_default_credentials: true

# Build docker image
- name: Build
run: |-
docker build -t eu.gcr.io/$PROJECT_ID/$GCR_NAME:$GITHUB_SHA .
docker build -t eu.gcr.io/${{ secrets.GOOGLE_CLOUD_PROJECT }}/${{ secrets.GCR_NAME }}:$GITHUB_SHA .
# Configure docker to use the gcloud command-line tool as a credential helper
- run: |
gcloud auth configure-docker -q
# Push image to Google Container Registry
- name: Push
run: |-
docker push eu.gcr.io/$PROJECT_ID/$GCR_NAME:$GITHUB_SHA
docker push eu.gcr.io/${{ secrets.GOOGLE_CLOUD_PROJECT }}/${{ secrets.GCR_NAME }}:$GITHUB_SHA
deploy_to_test:
name: Deploy Test Server to Google Cloud Run
Expand Down

0 comments on commit 235e387

Please sign in to comment.