Compare commits

...

2 Commits

Author SHA1 Message Date
vorpax
201e9002b4 update ci-cd
Some checks failed
Build and Push Docker Image - HEC IA Wiki / build-and-push (push) Failing after 1m7s
2026-02-02 10:42:09 +01:00
vorpax
14b1292de5 update ci-cd 2026-02-02 10:41:56 +01:00
5 changed files with 89 additions and 9 deletions

View File

@@ -44,3 +44,11 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy stack
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: cd ~/

57
.github/workflows/build-deploy.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Build and Push Docker Image - HEC IA Wiki
on:
push:
branches:
- main
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix=
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') || github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Deploy stack
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: git pull && docker compose -f compose.yaml pull && docker compose up -d

12
compose.yaml Normal file
View File

@@ -0,0 +1,12 @@
services:
app:
build: .
restart: unless-stopped
expose:
- 80
networks:
- public
networks:
public:
name: public
external: true

12
docker-compose-dev.yml Normal file
View File

@@ -0,0 +1,12 @@
services:
app:
build: .
restart: unless-stopped
expose:
- 80
networks:
- public
networks:
public:
name: public
external: true

View File

@@ -1,9 +0,0 @@
services:
app:
image: node:lts
ports:
- 4321:4321
working_dir: /app
command: npm run dev -- --host 0.0.0.0
volumes:
- ./:/app