ci: new deploy script
Some checks failed
/ Build (push) Failing after 50s

This commit is contained in:
log101 2024-05-31 18:20:37 +03:00
parent 84547b811a
commit 446aaeba69

View File

@ -6,6 +6,22 @@ jobs:
name: Build name: Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.3"
- name: Install dependencies
run: go get .
- name: Build
run: go build
- name: Transfer files
env:
- USERNAME: ${{ secrets.USERNAME }}
- HOST: ${{ secrets.HOST }}
- SSH_KEY: ${{ secrets.KEY }}
run: |
scp -o StrictHostKeyChecking=no -r log101-blog-services $USERNAME@$HOST:/home/$USERNAME
- name: Rebuild docker compose - name: Rebuild docker compose
uses: appleboy/ssh-action@v1.0.3 uses: appleboy/ssh-action@v1.0.3
with: with:
@ -13,6 +29,4 @@ jobs:
username: ${{ secrets.USERNAME }} username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }} key: ${{ secrets.KEY }}
script: | script: |
cd /home/log101/prod/log101.dev-services ls
git pull
docker compose up -d --build