workflows changes
This commit is contained in:
57
.gitea/workflows/docker-publish-dev.yaml
Normal file
57
.gitea/workflows/docker-publish-dev.yaml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: Build and Push Docker Image (Dev)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'client/**'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'docker-compose.dev.yml'
|
||||||
|
- 'package.json'
|
||||||
|
- '.gitea/workflows/docker-publish-dev.yaml'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.app.flexinit.nl
|
||||||
|
IMAGE_NAME: oussamadouhou/ai-stack-deployer
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-dev:
|
||||||
|
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: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: oussamadouhou
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=dev
|
||||||
|
type=sha,prefix=dev-
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
57
.gitea/workflows/docker-publish-main.yaml
Normal file
57
.gitea/workflows/docker-publish-main.yaml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: Build and Push Docker Image (Production)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'client/**'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'docker-compose.prod.yml'
|
||||||
|
- 'package.json'
|
||||||
|
- '.gitea/workflows/docker-publish-main.yaml'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.app.flexinit.nl
|
||||||
|
IMAGE_NAME: oussamadouhou/ai-stack-deployer
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-main:
|
||||||
|
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: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: oussamadouhou
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest
|
||||||
|
type=sha,prefix=main-
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
name: Build and Push Docker Image
|
name: Build and Push Docker Image (Staging)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
|
||||||
- staging
|
- staging
|
||||||
- main
|
|
||||||
paths:
|
paths:
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
- 'client/**'
|
- 'client/**'
|
||||||
- 'Dockerfile'
|
- 'Dockerfile'
|
||||||
- 'docker-compose*.yml'
|
- 'docker-compose.staging.yml'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
- '.gitea/workflows/**'
|
- '.gitea/workflows/docker-publish-staging.yaml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -20,7 +18,7 @@ env:
|
|||||||
IMAGE_NAME: oussamadouhou/ai-stack-deployer
|
IMAGE_NAME: oussamadouhou/ai-stack-deployer
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push-staging:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -46,10 +44,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=staging
|
||||||
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=sha,prefix=staging-
|
||||||
type=raw,value=staging,enable=${{ github.ref == 'refs/heads/staging' }}
|
|
||||||
type=sha,prefix={{branch}}-
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
Reference in New Issue
Block a user