Skip to content

Commit

Permalink
Upd: Github release worfklow
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Nov 15, 2023
1 parent 3926701 commit 8c29bad
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,54 @@ on:
release:
types: [created]

# Environment variables available to all jobs and steps in this workflow
env:
GITHUB_SHA: ${{ github.sha }}
GKE_ZONE: europe-west4-c
GKE_CLUSTER: igrant-cluster
REGISTRY_HOSTNAME: eu.gcr.io

jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

with:
submodules: 'recursive'
token: ${{ secrets.TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Extract tag from version
id: extract_tag
run: echo ::set-output name=TAG::$(echo ${{ steps.get_version.outputs.VERSION }} | sed 's/refs\/tags\///')

- name: Set Docker Tag
run: echo "DOCKER_HUB_TAG=${{steps.extract_tag.outputs.TAG}}" >> $GITHUB_ENV

- name: Login to Docker Hub
uses: docker/login-action@v3
# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@v0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

version: "270.0.0"
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- run: |-
gcloud --quiet auth configure-docker
# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

# Build the Go builder docker image
- name: Build the Go builder docker image
shell: 'script -q -e -c "bash {0}"'
run: |
make build/docker/builder
# Build docker image, publish docker image to docker hub
- name: Build docker image, publish docker image to docker hub
- name: Build docker image, publish docker image to docker image to docker hub
shell: 'script -q -e -c "bash {0}"'
run: |
make build/docker/deployable/dockerhub publish/dockerhub

0 comments on commit 8c29bad

Please sign in to comment.