artifacts/.github/workflows/sync-images.yaml
2023-02-20 10:47:32 +08:00

47 lines
1.4 KiB
YAML

name: Sync Images
on:
pull_request:
push:
paths:
- '.github/workflows/sync-images.yaml'
branches:
- main
env:
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-latest
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
docker pull gcr.io/kaniko-project/executor:v1.9.1
docker tag gcr.io/kaniko-project/executor:v1.9.1 artifact.onwalk.net/k8s/kaniko-executor:1.9.1
docker push artifact.onwalk.net/k8s/kaniko-executor:1.9.1
docker pull gcr.io/kaniko-project/executor:v1.9.1-debug
docker tag gcr.io/kaniko-project/executor:v1.9.1-debug artifact.onwalk.net/k8s/kaniko-executor:1.9.1-debug
docker push artifact.onwalk.net/k8s/kaniko-executor:1.9.1-debug