add sync-images.yaml

This commit is contained in:
Haitao Pan 2023-02-02 13:44:38 +08:00
parent 05e0d5502b
commit b35ff672c7

38
.github/workflows/sync-images.yaml vendored Normal file
View File

@ -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