From c250bdf00fa4be82978cc7e262213327e79a35bc Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Mon, 21 Aug 2023 21:12:02 +0500 Subject: [PATCH] Add deploy action --- .forgejo/workflows/deploy.yml | 22 ++++++++++++++++++++++ index.html | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/deploy.yml diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..2882be7 --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,22 @@ +on: [push] +jobs: + test: + runs-on: docker + container: + image: alpine:latest + steps: + - name: Install SSH + run: apk --no-cache add openssh-client + shell: sh + + - name: Configure SSH + run: | + mkdir -p ~/.ssh/ + chmod 700 ~/.ssh/ + echo "${{ secrets.SSH_KEY }}" > ~/.ssh/staging.key + chmod 600 ~/.ssh/staging.key + shell: sh + + - name: Test SSH + run: ssh -i ~/.ssh/staging.key -o StrictHostKeyChecking=no hadeed@hadeedahmad.xyz 'cd nginx/www; git pull' + shell: sh diff --git a/index.html b/index.html index 89624e9..393c065 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ Home - Hadeed Ahmad -

Welcome to my website

+

Welcome to my website!

+

There's not much right now, but soon this will be quite nice.