ci: automatic update ghcr & push nginx

This commit is contained in:
Ante Brähler
2024-12-25 15:37:16 +01:00
parent 127728f2c5
commit fbffea81e8
6 changed files with 47 additions and 7 deletions

38
.github/workflows/release-build.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Build and Publish Docker Images
on:
release:
types: [published]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Backend Image
run: |
docker build -t ghcr.io/antebrl/iptv-restream/backend:${{ github.event.release.tag_name }} ./backend
docker push ghcr.io/antebrl/iptv-restream/backend:${{ github.event.release.tag_name }}
- name: Build and Push Frontend Image
run: |
docker build --build-arg VITE_BACKEND_STREAMS_PATH=/streams/ --build-arg VITE_STREAM_DELAY=18 -t ghcr.io/antebrl/iptv-restream/frontend:${{ github.event.release.tag_name }} ./frontend
docker push ghcr.io/antebrl/iptv-restream/frontend:${{ github.event.release.tag_name }}
- name: Build and Push Nginx Image
run: |
docker build -t ghcr.io/antebrl/iptv-restream/nginx:${{ github.event.release.tag_name }} ./deployment/nginx
docker push ghcr.io/antebrl/iptv-restream/nginx:${{ github.event.release.tag_name }}

View File

@@ -34,7 +34,7 @@ services:
nginx:
image: nginx:alpine
volumes:
- ../nginx.conf:/etc/nginx/nginx.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- streams_data:/streams
networks:
- app-network

View File

@@ -1,12 +1,12 @@
version: "3.9"
services:
frontend:
image: ghcr.io/antebrl/iptv-restream/frontend:v1
image: ghcr.io/antebrl/iptv-restream/frontend:v2
networks:
- app-network
backend:
image: ghcr.io/antebrl/iptv-restream/backend:v1
image: ghcr.io/antebrl/iptv-restream/backend:v2
volumes:
- streams_data:/streams
environment:
@@ -17,12 +17,11 @@ services:
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
image: ghcr.io/antebrl/iptv-restream/nginx:v2
volumes:
- ../nginx.conf:/etc/nginx/nginx.conf
- streams_data:/streams
ports:
- "80:80"
- "80:80" # Configure exposed port, if 80 is already in use e.g. 8080:80
networks:
- app-network

View File

@@ -0,0 +1,3 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf

View File

@@ -34,7 +34,7 @@ services:
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./deployment/nginx/nginx.conf:/etc/nginx/nginx.conf
- streams_data:/streams
ports:
- "80:80"