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:
|
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
|
docker compose up -d
|
||||||
with:
|
docker image prune -f
|
||||||
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
|
|
||||||
|
|||||||
+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