36 lines
990 B
YAML
36 lines
990 B
YAML
name: Deploy to Server
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build API image
|
|
run: |
|
|
docker build -t rustycms-api:latest .
|
|
|
|
- name: Build Admin UI image
|
|
run: |
|
|
docker build \
|
|
--build-arg NEXT_PUBLIC_RUSTYCMS_API_URL=https://cms.pm86.de \
|
|
-t rustycms-admin:latest \
|
|
./admin-ui
|
|
|
|
- name: Deploy
|
|
run: |
|
|
echo "${{ secrets.SSH_DEPLOY_KEY }}" > /tmp/deploy_key
|
|
chmod 600 /tmp/deploy_key
|
|
rsync -avz --delete \
|
|
-e "ssh -o StrictHostKeyChecking=no -i /tmp/deploy_key" \
|
|
./types/ root@167.86.74.105:/opt/rustycms/types/
|
|
ssh -o StrictHostKeyChecking=no -i /tmp/deploy_key root@167.86.74.105 \
|
|
"docker compose -f /opt/rustycms/docker-compose.yml up -d && docker image prune -f"
|
|
rm /tmp/deploy_key
|