Skip to content

Promote to Client Staging #2

Promote to Client Staging

Promote to Client Staging #2

name: Promote to Client Staging
on:
workflow_dispatch:
inputs:
version:
description: 'Version to promote'
required: true
jobs:
promote:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Pull dev image
uses: docker/build-push-action@v2
with:
context: .
push: false
tags: sayinmehmet47/client-kitapkurdu-1:${{ github.event.inputs.version }}
load: true
- name: Retag image for staging
run: docker tag sayinmehmet47/client-kitapkurdu-1:${{ github.event.inputs.version }} sayinmehmet47/client-kitapkurdu-1:staging.${{ github.event.inputs.version }}
- name: Push staging image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: sayinmehmet47/client-kitapkurdu-1:staging.${{ github.event.inputs.version }}
- name: Deploy to Kubernetes
run: |
kubectl config set-cluster kubernetes --server="https://rancher.riwi.dev/k8s/clusters/c-m-cp898j4l"
kubectl config set-credentials github-action --token=${{ secrets.KUBE_CONFIG_TOKEN }}
kubectl config set-context default --cluster=kubernetes --user=github-action
kubectl config use-context default
kubectl set image deployment/frontend-deployment-dev frontend=sayinmehmet47/client-kitapkurdu-1:staging.${{ github.event.inputs.version }} -n kitapkurdu
env:
KUBECONFIG: kubeconfig