From 1ad2fb9a539332f76fb4454404d67020eb68f3f6 Mon Sep 17 00:00:00 2001 From: Dima Date: Wed, 10 Jan 2024 21:40:28 +0400 Subject: [PATCH] try ko --- .github/workflows/deploy.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 888b784..078dd25 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,29 +3,17 @@ name: Deploy to Server on: push: branches: - - master + - compose2 jobs: - deploy: + publish: + name: Publish runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install SSH key - run: | - mkdir -p ~/.ssh - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan -H "$SERVER_IP" >> ~/.ssh/known_hosts - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - SERVER_IP: ${{ secrets.SERVER_IP }} + - uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + - uses: actions/checkout@v3 - - name: SSH into the server and update the code - run: | - ssh $SERVER_USERNAME@$SERVER_IP 'cd /root/ytstalker && git pull && export PATH=$PATH:/usr/local/go/bin && go build . && systemctl restart ytstalker.service' - env: - SERVER_USERNAME: ${{ secrets.SERVER_USERNAME }} - SERVER_IP: ${{ secrets.SERVER_IP }} + - uses: ko-build/setup-ko@v0.6 + - run: ko build \ No newline at end of file