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
+7 -24
View File
@@ -7,40 +7,23 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: Runner
env: env:
REGISTRY: git.test APP_DIR: /opt/docker/apps/sveltekit-test
IMAGE: git.test/torscha/sveltekit-app:latest
DEPLOY_PATH: /opt/apps/sveltekit-app
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 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 - name: Build Docker image
run: | run: |
docker build -t $IMAGE . docker build -t sveltekit-test:latest .
- name: Push Docker image - name: Deploy
run: | run: |
docker push $IMAGE mkdir -p $APP_DIR
cp compose.yml $APP_DIR/compose.yml
- name: Deploy on Raspberry Pi cd $APP_DIR
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 compose up -d
docker image prune -f 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