Skip to content

Commit

Permalink
add autodeploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Apr 25, 2022
1 parent 43a534e commit c5de574
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
with:
images: kubeshop/tracetest
tags: |
type=match,pattern=v(.*)
type=sha
flavor: |
latest=true
Expand All @@ -46,3 +45,35 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


publish:
if: github.event.base_ref == 'refs/heads/main'
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v3

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

- run: |-
gcloud --quiet auth configure-docker
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

# Deploy the Docker image to the GKE cluster
- name: Deploy
run: |-
kubectl delete po -l app=beta-tracetest

0 comments on commit c5de574

Please sign in to comment.