From 576adb547cac5a3484aa1c53881e69bf0f729afd Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 8 Jan 2025 23:20:38 +0200 Subject: Implemented CD --- .github/workflows/cd.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/cd.yml (limited to '.github/workflows/cd.yml') diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..0c6c58a --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,42 @@ +name: continious deployment + +on: + push: + branches: [master] + +jobs: + cd: + name: Deploy + runs-on: ubuntu-latest + needs: ci + timeout-minutes: 5 + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.2" + + - name: Build executable + run: GOOS=linux GOARCH=amd64 go build ./cmd/server -o ./eko-server + + - name: Deploy to server + uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + ARGS: "-avz" + SOURCE: "eko-server" + REMOTE_HOST: eko.kyren.codes + REMOTE_USER: website + TARGET: "/srv/website" + SCRIPT_BEFORE: | + whoami + ls -al + SCRIPT_AFTER: | + whoami + ls -al + echo $RSYNC_STDOUT + -- cgit v1.3.1