summaryrefslogtreecommitdiff
path: root/.github/workflows/cd.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/cd.yml')
-rw-r--r--.github/workflows/cd.yml42
1 files changed, 42 insertions, 0 deletions
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
+