Change deploy action and dockerfile, add compose.yml
Build and Deploy / build-and-deploy (push) Failing after 15s

This commit is contained in:
Torben Schaffhauser
2026-06-27 18:15:27 +02:00
parent a14f753f2b
commit abd4c099b6
2 changed files with 20 additions and 26 deletions
+9 -26
View File
@@ -7,40 +7,23 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
runs-on: Runner
env:
REGISTRY: git.test
IMAGE: git.test/torscha/sveltekit-app:latest
DEPLOY_PATH: /opt/apps/sveltekit-app
APP_DIR: /opt/docker/apps/sveltekit-test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY \
-u "${{ secrets.REGISTRY_USER }}" \
--password-stdin
- name: Build Docker image
run: |
docker build -t $IMAGE .
docker build -t sveltekit-test:latest .
- name: Push Docker image
- name: Deploy
run: |
docker push $IMAGE
- name: Deploy on Raspberry Pi
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.DEPLOY_HOST }}
port: 2222
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd /opt/apps/sveltekit-app
docker compose pull
docker compose up -d
docker image prune -f
mkdir -p $APP_DIR
cp compose.yml $APP_DIR/compose.yml
cd $APP_DIR
docker compose up -d
docker image prune -f
+11
View File
@@ -0,0 +1,11 @@
services:
app:
image: sveltekit-test:latest
container_name: sveltekit-test
restart: unless-stopped
networks:
- proxy
networks:
proxy:
external: true