Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add workflow to synchronize ubuntu base image #2526

Merged
merged 29 commits into from
Jul 17, 2024
Merged
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/dockers-image-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: "Sync Docker image from Docker Hub to GHCR"
on:
# TODO: The following events are for debugging purposes so I will remove them before merging.
pull_request:

schedule:
- cron: "0 1 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref != 'refs/heads/main' && github.ref || github.sha }}-${{ github.event_name }}
cancel-in-progress: true
env:
ORG: vdaas
REPO: vald
jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
target_images: ["ubuntu:devel"]
# platforms: [linux/amd64, linux/arm/v7, linux/arm64/v8]
platforms: [linux/amd64 linux/arm/v7]
steps:
- uses: actions/checkout@v4
- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
platforms: linux/amd64,linux/arm64
driver-opts: |
image=moby/buildkit:master
network=host
buildkitd-flags: "--debug --oci-worker-gc=false"
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.PACKAGE_USER }}
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Pull Docker image from Docker Hub
run: |
docker pull --platform linux/amd64 \
--platform linux/arm/v7 \
--platform linux/arm/v8 ${{ matrix.target_images }}
- name: Tag Docker image for GHCR
run: |
docker tag ubuntu:devel ghcr.io/vdaas/vald/buildbase:devel-amd64 --platform linux/amd64
docker tag ubuntu:devel ghcr.io/vdaas/vald/buildbase:devel-arm64-v7 --platform linux/arm64/v7
docker tag ubuntu:devel ghcr.io/vdaas/vald/buildbase:devel-arm64-v8 --platform linux/arm64/v8
# docker tag ${{ matrix.target_images }} ghcr.io/${ORG}/${REPO}/build-base
# docker images
Loading