Deploy debc13220025d2e803bb13025115f7b422145356 #44
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 | |
| concurrency: Vostro | |
| run-name: Deploy ${{github.sha}} | |
| on: | |
| workflow_run: | |
| workflows: [Lint] | |
| branches: [main] | |
| types: [completed] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| run: echo $DOCKER_TOKEN | docker login -u coder80 --password-stdin | |
| env: | |
| DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}} | |
| - name: Build container | |
| run: docker build -t coder80/usmile:latest -t coder80/usmile:$SHA . | |
| env: | |
| SHA: ${{ github.sha }} | |
| - name: Push latest tag to Docker Hub | |
| run: docker push coder80/usmile:latest | |
| - name: Push commit sha tag to Docker Hub | |
| run: docker push coder80/usmile:$SHA | |
| env: | |
| SHA: ${{ github.sha }} | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: Vostro | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| - name: Deploy | |
| uses: actions-hub/kubectl@master | |
| env: | |
| KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} | |
| with: | |
| args: --namespace=usmile set image deployments/main main=coder80/usmile:${{ github.SHA }} |