Merge pull request #58 from nik-danilov/master #37
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: "Build docker image from master branch" | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'english' | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: petrkalinin/progtexts2-master:latest,petrkalinin/progtexts2-master:${{ github.sha }} | |
- | |
name: Set kubectl context | |
uses: azure/k8s-set-context@v1 | |
id: setcontext | |
with: | |
method: service-account | |
k8s-url: ${{ secrets.K8S_URL }} | |
k8s-secret: ${{ secrets.K8S_SECRET }} | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
- | |
name: Deploy to k8s | |
uses: Azure/k8s-deploy@v1.4 | |
with: | |
manifests: | | |
k8s/deployment.yaml | |
k8s/service.yaml | |
images: 'petrkalinin/progtexts2-master:${{ github.sha }}' | |
kubectl-version: 'latest' | |
- | |
name: send telegram message | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} |