[fix] #22
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: kotyari_deploy | |
on: | |
push: | |
branches: [ dev ] | |
jobs: | |
build: | |
name: go-build and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.23 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.23 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Get dependencies | |
run: go mod tidy | |
- name: Run make test | |
run: go test ./... | |
linter: | |
name: go-lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.62 | |
deploy: | |
name: Deploy to VM | |
needs: [build, linter] | |
runs-on: ubuntu-latest | |
environment: CICD | |
timeout-minutes: 50 | |
steps: | |
- name: Execute commands over ssh | |
uses: appleboy/ssh-action@master | |
with: | |
command_timeout: '50m' | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd ./back_kotyari | |
sudo git stash | |
sudo git checkout dev | |
sudo git pull | |
sudo git stash pop | |
sudo make back-refresh | |
sudo docker system prune -f |