Skip to content

Commit

Permalink
prepare github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-moha committed Nov 5, 2024
1 parent 08e4f08 commit 1fa96c0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/build-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
cache_id:
required: true
type: string
secret:
required: false
type: string
default: ""
extract_flavor:
required: false
default: ""
Expand All @@ -29,6 +33,10 @@ on:
env:
FULL_IMAGE_NAME: ${{ inputs.registry }}/${{ inputs.image_name }}

permissions:
contents: read
packages: write

jobs:
build-image:
runs-on: ubuntu-latest
Expand All @@ -55,14 +63,14 @@ jobs:
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
password: ${{ inputs.secret }}

- name: Extract metadata for Docker images
id: meta
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/docker-build-bizgpt.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
name: Create and publish Docker images with specific build args
name: publish

on:
workflow_dispatch:
push:
branches:
- bizgpt

jobs:
build-main-image:
uses: ./.github/workflows/build-docker-image.yaml
with:
image_name: ${{ github.repository }}
cache_id: bizgpt
image_tag: bizgpt
publish-pipeline-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }} # Changed from GHCR_TOKEN to GITHUB_TOKEN

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/chatcrm/bizgpt-openwebui-pipeline:bizgpt

0 comments on commit 1fa96c0

Please sign in to comment.