feat: update deployment workflow and docker-compose for Gitea integration
Some checks failed
Build & Deploy / build (push) Failing after 21s
Some checks failed
Build & Deploy / build (push) Failing after 21s
This commit is contained in:
@@ -1,24 +1,58 @@
|
||||
name: Deploy
|
||||
name: Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
IMAGE: ${{ vars.REGISTRY_URL }}/${{ github.repository_owner }}/slaapkampioen
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
# ── 1. Bouw de Docker image en push naar Gitea registry ──
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@master
|
||||
- name: Log in to Gitea registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
username: ${{ secrets.DEPLOY_USER }}
|
||||
key: ${{ secrets.DEPLOY_KEY }}
|
||||
script: |
|
||||
cd /opt/slaapkampioen
|
||||
git pull
|
||||
docker compose build --no-cache
|
||||
docker compose up -d
|
||||
docker compose logs --tail=20 app
|
||||
registry: ${{ vars.REGISTRY_URL }}
|
||||
username: ${{ vars.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build & push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.IMAGE }}:latest
|
||||
${{ env.IMAGE }}:${{ github.sha }}
|
||||
|
||||
# # ── 2. Deployen op de server via SSH ──
|
||||
# deploy:
|
||||
# needs: build
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Deploy via SSH
|
||||
# uses: appleboy/ssh-action@master
|
||||
# with:
|
||||
# host: ${{ vars.DEPLOY_HOST }}
|
||||
# username: ${{ vars.DEPLOY_USER }}
|
||||
# key: ${{ secrets.DEPLOY_KEY }}
|
||||
# script: |
|
||||
# # Inloggen op de Gitea registry (voor docker pull)
|
||||
# echo "${{ secrets.REGISTRY_TOKEN }}" | \
|
||||
# docker login ${{ vars.REGISTRY_URL }} \
|
||||
# -u ${{ vars.REGISTRY_USER }} --password-stdin
|
||||
|
||||
# cd ${{ vars.DEPLOY_PATH }}
|
||||
|
||||
# # Nieuwste image pullen en container herstarten
|
||||
# docker compose pull
|
||||
# docker compose up -d
|
||||
|
||||
# # Oude images opruimen
|
||||
# docker image prune -f
|
||||
Reference in New Issue
Block a user