summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-01-08 23:20:38 +0200
committerKyren223 <Kyren223@proton.me>2025-01-08 23:20:38 +0200
commit576adb547cac5a3484aa1c53881e69bf0f729afd (patch)
treee446da8d683774ef7263338d5b4ef2b5d172c898 /.github
parentdbea21d9c3642fce6b25837c2ec5fd704a7e8f2a (diff)
Implemented CD
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/cd.yml42
-rw-r--r--.github/workflows/ci.yml6
2 files changed, 44 insertions, 4 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
+
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 66462ed..4838878 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,15 +1,13 @@
-name: ci
+name: continious integration
on:
- push:
- branches: [master]
pull_request:
- branches: [master]
jobs:
ci:
name: Tests
runs-on: ubuntu-latest
+ timeout-minutes: 5
steps:
- name: Check out code