Akulij 440cdd5a2c
All checks were successful
Build && Deploy / go build (push) Successful in 16s
cd.yaml: call deployment webhook
2025-05-05 20:14:04 +03:00

43 lines
1.3 KiB
YAML

name: Build && Deploy
on: [push]
jobs:
build:
name: go build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Restore cached build dependencies
id: cache-project-dependencies
uses: actions/cache/restore@v4
with:
path: |
~/.cache/go-build
key: linux-project-dependencies
- run: go env -w CGO_ENABLED=1
- run: go build -o app ./cmd/app
- name: Save cached build dependencies
id: cache-project-dependencies-restore
uses: actions/cache/save@v4
with:
path: |
~/.cache/go-build
key: ${{ steps.cache-project-dependencies.outputs.cache-primary-key }}
- name: Upload Release Binary
id: bot-artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
name: botrunner
path: app
- name: Deploy with WebHook
# temporary solutino to hardcode artifact url, because upload-artifact's artifact-url gives wrong one
run: curl http://${{ secrets.SERVER_ADDR }}/hooks/gongbotgo-deploy?binaryzip='https://git.akulij.ru/akulij/sinkbot/actions/runs/${{ gitea.run_number }}/artifacts/botrunner'