Change deploy action and dockerfile, add compose.yml
Build and Deploy / build-and-deploy (push) Failing after 15s
Build and Deploy / build-and-deploy (push) Failing after 15s
This commit is contained in:
@@ -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
|
||||
mkdir -p $APP_DIR
|
||||
cp compose.yml $APP_DIR/compose.yml
|
||||
cd $APP_DIR
|
||||
docker compose up -d
|
||||
docker image prune -f
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
app:
|
||||
image: sveltekit-test:latest
|
||||
container_name: sveltekit-test
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
Reference in New Issue
Block a user