Update logs and client UI #3
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
name: Backend Build & Deploy | |
on: | |
push: | |
branches: [dev] | |
paths: | |
- 'backend/**' | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- run: cd backend | |
- name: set version | |
run: echo "TAG_VERSION=dev.$(date +'%y-%m-%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV | |
- name: Login to DockerHub | |
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push backend | |
uses: docker/build-push-action@v5 | |
with: | |
context: backend/ | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
sayinmehmet47/backend-kitapkurdu-1:dev | |
sayinmehmet47/backend-kitapkurdu-1:${{ env.TAG_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 kitapkurdu=sayinmehmet47/backend-kitapkurdu-1:${{ env.TAG_VERSION }} -n kitapkurdu |