-
Notifications
You must be signed in to change notification settings - Fork 718
53 lines (45 loc) · 1.84 KB
/
regsync-config.yaml
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
# Generate-Regsync-Config action will checkout release-v2.7 branch, run make regsync target and
# creates a pull request from rancherbot/charts or rancher/charts release-v2.7 branch with any image additions
# to regsync config file. This action is triggered whenever something is pushed into release-v2.7 branch.
name: Generate-Regsync-Config
on:
pull_request_review:
types: [submitted, edited]
jobs:
build:
if: github.event.pull_request.base.ref == 'release-v2.7'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Need to remove export version once rancher/charts gets the latest version
# of charts-build-script binary.
- name: Generate RegSync & Commit
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export CHARTS_BUILD_SCRIPT_VERSION=v0.4.2
make pull-scripts
make regsync
git add regsync.yaml
git config --global user.name "Github Action RegSync"
git config --global user.email "github@action.com"
git commit -m "Updating regsync.yaml"
git branch
git status
env:
GH_TOKEN: ${{ github.token }}
- name: Install Regsync
run: |
curl --silent --fail --location --output regsync https://github.com/regclient/regclient/releases/download/v0.4.8/regsync-linux-amd64
chmod +x regsync
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
env:
GH_TOKEN: ${{ github.token }}
- name: Sync Images to Registry
run: |
head regsync.yaml
time ./regsync once --config regsync.yaml
env:
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}