Skip to content

Merge pull request #1951 from atsign-foundation/dependabot/docker/pac… #89

Merge pull request #1951 from atsign-foundation/dependabot/docker/pac…

Merge pull request #1951 from atsign-foundation/dependabot/docker/pac… #89

name: at_root deploy (dev)
on:
push:
branches:
- trunk
paths:
- packages/*_root_server/**
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
Docker_Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
# Extract branch for docker tag
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Login to DockerHub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Build the Docker image for Dev
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
file: packages/at_root_server/Dockerfile
context: packages/at_root_server
push: true
tags: |
atsigncompany/root:dev_env
atsigncompany/root:dev_env-gha${{ github.run_number }}
atsigncompany/root:dev_env-${{ env.BRANCH }}-gha${{ github.run_number }}
Deploy_On_Dev_K8:
needs: Docker_Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
# Extract branch for docker tag
- name: Get branch name
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
# Setup gcloud CLI
- id: 'auth'
uses: google-github-actions/auth@55bd3a7c6e2ae7cf1877fd1ccb9d54c0503c457c # v2.1.2
with:
credentials_json: '${{ secrets.GKE_SA_DEV_KEY }}'
- name: 'Set up Cloud SDK'
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@c02be8662df01db62234e9b9cff0765d1c1827ae # v2.1.0
with:
cluster_name: ${{ secrets.GKE_DEV_CLUSTER }}
location: ${{ secrets.GKE_DEV_ZONE }}
# Deploy the Docker image to the GKE cluster
- name: Deploy
run: |-
kubectl -n root set image statefulset root root=atsigncompany/root:dev_env-gha${{ github.run_number }}