Skip to content

Commit bbdd689

Browse files
committed
staging
1 parent f00cafa commit bbdd689

File tree

3 files changed

+64
-30
lines changed

3 files changed

+64
-30
lines changed

.github/workflows/build_push.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build and push
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: self-hosted
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Log in to GHCR
18+
uses: docker/login-action@v3
19+
with:
20+
registry: ghcr.io
21+
username: ${{ github.actor }}
22+
password: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Build and push rag-2-ai image
25+
uses: docker/build-push-action@v5
26+
with:
27+
context: .
28+
file: Dockerfile
29+
push: true
30+
tags: |
31+
ghcr.io/skni-kod/stronapracekol:${{ github.ref_name }}

.github/workflows/dev.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/staging.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Staging deploy
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
build:
13+
uses: ./.github/workflows/build_push.yml
14+
15+
deploy:
16+
needs: [build]
17+
environment: staging
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Staging deploy
21+
uses: appleboy/ssh-action@master
22+
with:
23+
host: ${{ secrets.REMOTE_HOST }}
24+
username: ${{ secrets.REMOTE_USER }}
25+
port: ${{ secrets.REMOTE_PORT }}
26+
key: ${{ secrets.SSH_PRIVATE_KEY }}
27+
script: |
28+
set -e
29+
30+
cd /home/pracekol_staging
31+
32+
docker compose --file docker-compose.stag.yml pull && docker compose --file docker-compose.stag.yml up -d
33+
docker system prune -a -f

0 commit comments

Comments
 (0)