31 lines
831 B
YAML
Raw Normal View History

2023-11-18 20:02:23 +01:00
name: CI/CD Pipeline
2024-01-17 19:52:54 +01:00
on: push
2023-11-18 20:02:23 +01:00
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
jobs:
deploy-main:
runs-on: ubuntu-latest
2024-02-17 12:47:06 +01:00
container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240118
2023-11-18 20:02:23 +01:00
if: github.ref == 'refs/heads/main'
2023-11-18 21:46:00 +01:00
steps:
2023-11-18 20:02:23 +01:00
- name: Checkout
uses: actions/checkout@v3
2024-01-17 23:23:58 +01:00
- name: Deploy to production
2023-11-18 20:02:23 +01:00
run: |
2024-01-17 23:23:58 +01:00
mkdir -p ~/.ssh
2023-11-19 22:01:14 +01:00
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
2024-02-17 12:47:06 +01:00
scp ./output/* $SSH_USER@$SSH_HOST:/var/www/html/ris/
2023-11-18 20:02:23 +01:00
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}