2024-02-16 12:13:24 +01:00
|
|
|
name: CI/CD Pipeline
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240215
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Tests
|
|
|
|
run: cargo test --verbose
|
2024-02-17 11:22:45 +01:00
|
|
|
|
2024-02-17 12:10:57 +01:00
|
|
|
deploy:
|
2024-02-17 11:22:45 +01:00
|
|
|
runs-on: ubuntu-latest
|
2024-02-17 12:25:11 +01:00
|
|
|
container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240215
|
2024-02-17 11:22:45 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
run: |
|
|
|
|
mkdir -p ~/.ssh
|
|
|
|
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
|
|
|
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
|
|
|
chmod 600 ~/.ssh/id_rsa
|
|
|
|
|
|
|
|
scp ./output/* $SSH_USER@$SSH_HOST:/var/www/html/ris/
|
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
|
|
|
SSH_USER: ${{ secrets.SSH_USER }}
|