Create main.yml

This commit is contained in:
Bastian Wagner
2024-09-08 13:02:49 +02:00
committed by GitHub
parent c8dd434fce
commit e3ec4cb4d2

20
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Docker Image CI for GHCR
on:
push:
branches:
- master
jobs:
ssh-login-and-publish:
runs-on: ubuntu-latest
steps:
- name: Setup SSH Keys and known_hosts
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SERVER_HOST }} > ~/.ssh/known_hosts
- name: connect and pull
run: |
ssh ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }} "cd repositories/idp && git pull && cd idp && npm i && npm run build // cd ../idp_client && npm i && npm run build // pm2 restart 3"