Generate-Regsync-Config #495
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate-Regsync-Config action will run for every PR into release-v2.7 branch only after an approval is given | |
# It will run make target to generate regsync file and add a commit to the PR updating the regsync file. | |
# It will then install and run regsync client and do the prime image mirroring. | |
name: Generate-Regsync-Config | |
on: | |
pull_request_review: | |
types: [submitted, edited] | |
jobs: | |
build: | |
if: github.event.review.state == 'approved' && 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 push | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Install Regsync | |
run: | | |
curl --silent --fail --location --output regsync https://github.com/regclient/regclient/releases/download/v0.5.1/regsync-linux-amd64 | |
chmod +x regsync | |
- name: Sync Images to Registry | |
# time ./regsync once --config regsync.yaml | |
run: | | |
head regsync.yaml | |
ruby ./regsync-split.rb | |
time find regsync -type f -name regsync.yaml -print -exec time regsync once --config '{}' ';' | |
env: | |
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }} | |
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} |