From 9db13487702db783fd45fe8648edba5486843876 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 2 Feb 2023 13:44:38 +0800 Subject: [PATCH] add sync-images.yaml --- .github/workflows/sync-images.yaml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/sync-images.yaml diff --git a/.github/workflows/sync-images.yaml b/.github/workflows/sync-images.yaml new file mode 100644 index 0000000..f433271 --- /dev/null +++ b/.github/workflows/sync-images.yaml @@ -0,0 +1,38 @@ +name: Sync Images + +on: + pull_request: + push: + paths: + - '.github/workflows/sync-images.yaml' + branches: + - main + +env: + TZ: Asia/Shanghai + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@main + with: + ref: ${{ github.head_ref }} + + - name: Initialization environment + env: + REPO_PASSWORD: ${{ secrets.HELM_REPO_PASSWORD }} + shell: bash + run: | + sudo apt update + sudo apt install git -y + sudo timedatectl set-timezone "$TZ" + echo "$REPO_PASSWORD" | docker login --username=admin --password-stdin artifact.onwalk.net + + - name: Sync images + shell: bash + run: | + docker pull gcr.io/kaniko-project/executor:debug + docker tag gcr.io/kaniko-project/executor:debug artifact.onwalk.net/k8s/kaniko-executor:debug + docker push artifact.onwalk.net/k8s/kaniko-executor:debug