Skip to content

Commit

Permalink
fix: add docker tagging
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jul 17, 2024
1 parent 8eb1064 commit 300b9fd
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/dockers-image-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: "Sync Docker image from Docker Hub to GitHub Container Registry"
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:
Expand All @@ -23,21 +23,23 @@ on:
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-devel:
ubuntu:
runs-on: ubuntu-latest

strategy:
matrix:
target_images: [ubuntu:devel]
# platforms: [linux/amd64, linux/arm/v7, linux/arm64/v8]
platforms: [linux/amd64]

steps:
- uses: actions/checkout@v4
- name: Set Git config
Expand All @@ -53,12 +55,12 @@ jobs:
image=moby/buildkit:master
network=host
buildkitd-flags: "--debug --oci-worker-gc=false"
- name: Login to DockerHub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Login to GitHub Container Registry
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -68,6 +70,8 @@ jobs:
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Pull Docker image from Docker Hub
run: |
docker pull --platform ${TARGET_PLATFORM} ubuntu:devel
env:
TARGET_PLATFORM: ${{ matrix.platforms }}
docker pull --platform ${{ matrix.platforms }} ${{ matrix.target_images }}
- name: Tag Docker image for GHCR
run: |
docker tag ${{ matrix.target_images }} ghcr.io/${ORG}/${REPO}/${{ matrix.target_images }}
docker images

0 comments on commit 300b9fd

Please sign in to comment.