website-risg/.gitea/workflows/action.yml

31 lines
831 B
YAML
Raw Normal View History

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