forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 16
66 lines (58 loc) · 2.21 KB
/
bundle-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Bundle Sync CI
on:
workflow_dispatch:
push:
branches:
- 'rhoai-2.1[6-9]+' # Trigger the workflow on pushes to any rhoai-* branch
paths:
- 'bundle/**' # Trigger the workflow for changes to any file in the bundle directory
- 'Dockerfiles/bundle.Dockerfile' # Trigger the workflow for changes to the Dockerfile
permissions:
contents: read
packages: write
id-token: write
env:
GITHUB_ORG: red-hat-data-services
GITHUB_RKA_ORG: rhoai-rhtap
jobs:
sync:
if: ${{ github.ref_name != 'main' }}
runs-on: ubuntu-latest
steps:
- name: Generate github-app token
id: app-token
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.RHOAI_DEVOPS_APP_ID }}
private_key: ${{ secrets.RHOAI_DEVOPS_APP_PRIVATE_KEY }}
- name: Checkout source repo
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_ORG }}/rhods-operator
path: source_repo
ref: ${{ github.ref_name }} # Use the same branch name as in the event
token: ${{ steps.app-token.outputs.token }}
- name: Checkout target repo
uses: actions/checkout@v3
with:
repository: ${{ env.GITHUB_ORG }}/RHOAI-Build-Config
path: target_repo
ref: ${{ github.ref_name }} # Use the same branch name as in the event
token: ${{ steps.app-token.outputs.token }}
- name: Sync Bundle Files
run: |
mkdir -p target_repo/to-be-processed/bundle
echo "Updating bundle related files"
cp -r source_repo/bundle/* target_repo/to-be-processed/bundle
# echo "Updating Dockerfile"
# cp source_repo/Dockerfiles/bundle.Dockerfile target_repo/to-be-processed/bundle/Dockerfile
- name: Commit and push the changes to release branch
uses: actions-js/push@master
with:
github_token: ${{ steps.app-token.outputs.token }}
branch: ${{ github.ref_name }}
message: "Sync changes from source repo"
repository: ${{ env.GITHUB_ORG }}/RHOAI-Build-Config
directory: target_repo
author_name: Openshift-AI DevOps
author_email: [email protected]