Update: changed kub cluster id #9
This file contains hidden or 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: Deploy Transcoder Service | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Get commit SHA | |
| id: vars | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| jacksoncheriyan05/transcoder-service:latest | |
| jacksoncheriyan05/transcoder-service:${{ steps.vars.outputs.sha_short }} | |
| - name: Install doctl | |
| uses: digitalocean/action-doctl@v2 | |
| with: | |
| token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
| - name: Connect to Kubernetes cluster | |
| run: doctl kubernetes cluster kubeconfig save 8a450773-40c9-4c56-a6fd-8e64d08194ac | |
| - name: Update Kubernetes deployment | |
| run: | | |
| kubectl set image deployment/transcoder-service transcoder-service=jacksoncheriyan05/transcoder-service:${{ steps.vars.outputs.sha_short }} -n dowhilelearn |