Auto deploy

This commit is contained in:
2022-02-05 14:45:38 +03:00
parent 8c48dd2e75
commit c3afa3b834
6 changed files with 53 additions and 0 deletions

35
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Deploy to k8s
on: [ workflow_dispatch ]
env:
DOCKER_TAG: "${{ secrets.DOCKER_REGISTRY }}/landing:${{ github.sha }}"
HELM_HELPER: ${{ secrets.HELM_HELPER_IMAGE }}
NAMESPACE: "landing"
jobs:
build:
runs-on: self-hosted
steps:
- name: Get repository
uses: actions/checkout@v2
- run: docker login -u ${{ secrets.DOCKER_REGISTRY_USER }} -p ${{ secrets.DOCKER_REGISTRY_PASSWORD }} "${{ secrets.DOCKER_REGISTRY }}"
- name: Build
run: docker build -t "${{ env.DOCKER_TAG }}" .
- name: Push
run: docker push "${{ env.DOCKER_TAG }}"
deploy:
needs:
- build
runs-on: helm-deploy
steps:
- run: docker login -u ${{ secrets.DOCKER_REGISTRY_USER }} -p ${{ secrets.DOCKER_REGISTRY_PASSWORD }} "${{ secrets.DOCKER_REGISTRY }}"
- run: |
docker run ${{ env.HELM_HELPER }} helm upgrade landing ./landing \
--install \
--wait \
--force \
--namespace ${{ env.NAMESPACE }} \
--create-namespace \
--set-string imageTag=${{ github.sha }}