artifacts/.github/workflows/sync-images.yaml
2024-02-24 16:02:00 +08:00

55 lines
1.9 KiB
YAML

name: SYNC Images
on:
schedule:
- cron: "0 0 * * *"
pull_request:
push:
paths:
- 'charts'
- '.github/workflows/sync-images.yaml'
workflow_dispatch:
branches:
- main
env:
REPO_URL: https://github.com/open-source-solution-design/MicroService.git
REPO_BRANCH: main
TZ: Asia/Shanghai
TAG: 0.1.4
jobs:
sync-fluxcd-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Initialization environment
env:
PASSWORD: ${{ secrets.HELM_REPO_PASSWORD }}
shell: bash
run: |
sudo apt update
sudo apt install git -y
echo "$PASSWORD" | docker login --username=admin --password-stdin artifact.onwalk.net
- name: Sync images
shell: bash
run: |
function sync_image()
{
local src_image=$1
local dest_image=$2
docker pull $src_image
docker tag $src_image $dest_image
docker push $dest_image
}
sync_image "ghcr.io/fluxcd/flux-cli:v2.2.0" "artifact.onwalk.net/public/fluxcd/flux-cli:v2.2.0"
sync_image "ghcr.io/fluxcd/helm-controller:v0.37.0" "artifact.onwalk.net/public/fluxcd/helm-controller:v0.37.0"
sync_image "ghcr.io/fluxcd/image-automation-controller:v0.37.0" "artifact.onwalk.net/public/fluxcd/image-automation-controller:v0.37.0"
sync_image "ghcr.io/fluxcd/image-reflector-controller:v0.31.1" "artifact.onwalk.net/public/fluxcd/image-reflector-controller:v0.31.1"
sync_image "ghcr.io/fluxcd/kustomize-controller:v1.2.0" "artifact.onwalk.net/public/fluxcd/kustomize-controller:v1.2.0"
sync_image "ghcr.io/fluxcd/notification-controller:v1.2.2" "artifact.onwalk.net/public/fluxcd/notification-controller:v1.2.2"
sync_image "ghcr.io/fluxcd/source-controller:v1.2.2" "artifact.onwalk.net/public/fluxcd/source-controller:v1.2.2"