Add Gitea Actions workflow (migrated from Jenkins)
Build and Deploy / build-and-deploy (push) Has started running
Build and Deploy / build-and-deploy (push) Has started running
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build and Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
options: -v /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t impulse-jail:latest -t impulse-jail:${{ github.sha }} .
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
docker stop impulse-jail || true
|
||||||
|
docker rm impulse-jail || true
|
||||||
|
mkdir -p /data/impulse-jail
|
||||||
|
chown 1001:1001 /data/impulse-jail
|
||||||
|
docker run -d \
|
||||||
|
--name impulse-jail \
|
||||||
|
--network nginx \
|
||||||
|
-p 3002:3000 \
|
||||||
|
-v /data/impulse-jail:/app/data \
|
||||||
|
-e DATABASE_URL=file:/app/data/prod.db \
|
||||||
|
--restart unless-stopped \
|
||||||
|
impulse-jail:latest
|
||||||
Reference in New Issue
Block a user