Skip to content

Commit

Permalink
split jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com>
  • Loading branch information
XuehaoSun committed Aug 16, 2024
1 parent 5a6015f commit f1d2ecc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/manual-freeze-images.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Freeze-requirements
name: Freeze-images

on:
workflow_dispatch:

jobs:
freeze-requirements:
freeze-images:
runs-on: ubuntu-latest

steps:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/manual-freeze-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Freeze-tag

on:
workflow_dispatch:
inputs:
tag:
default: "latest"
description: "Tag to apply to images"
required: true
type: string

jobs:
freeze-tag:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Set up Git
run: |
git config --global user.name "NeuralChatBot"
git config --global user.email "grp_neural_chat_bot@intel.com"
git remote set-url origin https://NeuralChatBot:"${{ secrets.ACTION_TOKEN }}"@github.com/opea-project/GenAIExamples.git
- name: Run script
run: |
find . -name "*.md" | xargs sed -i "s|^docker\ compose|TAG=${{ github.event.inputs.tag }}\ docker\ compose|g"
- name: Commit changes
run: |
git add .
git commit -s -m "Freeze images tag"
git push
4 changes: 0 additions & 4 deletions .github/workflows/scripts/freeze_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ function replace_image_version() {
find . -name "Dockerfile" | xargs sed -i "s|$repo_image:latest|$repo_image:$version|g"
}

function freeze_tag_in_markdown() {
find . -name "*.md" | xargs sed -i "s|^docker\ compose|TAG=$GITHUB_REF_NAME\ docker\ compose|g"
}

function check_branch_name() {
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
echo "$GITHUB_REF_NAME is protected branch"
Expand Down

0 comments on commit f1d2ecc

Please sign in to comment.