-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update function to handle edge cases
- Loading branch information
1 parent
1b2ed77
commit f0743fa
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Promote to Backend 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: ./backend | ||
push: false | ||
tags: sayinmehmet47/backend-kitapkurdu-1:${{ github.event.inputs.version }} | ||
load: true | ||
|
||
- name: Retag image for staging | ||
run: docker tag sayinmehmet47/backend-kitapkurdu-1:${{ github.event.inputs.version }} sayinmehmet47/backend-kitapkurdu-1:staging.${{ github.event.inputs.version }} | ||
|
||
- name: Push staging image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./backend | ||
push: true | ||
tags: sayinmehmet47/backend-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/backend-deployment-dev backend=sayinmehmet47/backend-kitapkurdu-1:staging.${{ github.event.inputs.version }} -n kitapkurdu | ||
env: | ||
KUBECONFIG: kubeconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 |