Testing CI
This commit is contained in:
parent
09a086517c
commit
5150da0bb0
@ -1,36 +1,14 @@
|
|||||||
name: Deploy to Server
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
say-hello:
|
||||||
runs-on: docker
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: alpine:latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- uses: actions/checkout@v3
|
||||||
run: |
|
- name: Greet
|
||||||
apk add --no-cache openssh git bash
|
run: echo "CI is working on Gitea!"
|
||||||
|
|
||||||
- name: Setup SSH
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
||||||
chmod 700 ~/.ssh
|
|
||||||
ssh-keyscan "$SSH_HOST" >> ~/.ssh/known_hosts
|
|
||||||
chmod 644 ~/.ssh/known_hosts
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
||||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
|
||||||
|
|
||||||
- name: Deploy via SSH
|
|
||||||
run: |
|
|
||||||
ssh -p "$SSH_PORT" "$SSH_USER@$SSH_HOST" 'cd /home/rogsme/repo && git stash && git pull --force origin master && ./build.sh'
|
|
||||||
env:
|
|
||||||
SSH_USER: ${{ secrets.SSH_USER }}
|
|
||||||
SSH_HOST: ${{ secrets.SSH_HOST }}
|
|
||||||
SSH_PORT: ${{ secrets.SSH_PORT }}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user