Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
76126333
Commit
76126333
authored
10 months ago
by
🥺
Committed by
🥺
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
ci: push to gitlab container registry too
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
5fe146aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/ci.yml
+25
-0
25 additions, 0 deletions
.github/workflows/ci.yml
.gitlab-ci.yml
+0
-43
0 additions, 43 deletions
.gitlab-ci.yml
with
25 additions
and
43 deletions
.github/workflows/ci.yml
+
25
−
0
View file @
76126333
...
@@ -233,7 +233,12 @@ jobs:
...
@@ -233,7 +233,12 @@ jobs:
GHCR_AMD64
:
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}-amd64
GHCR_AMD64
:
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}-amd64
GHCR_TAG
:
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}
GHCR_TAG
:
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}
GHCR_BRANCH
:
ghcr.io/${{ github.repository }}:${{ (github.ref == 'refs/heads/main' && 'latest') || github.ref_name }}
GHCR_BRANCH
:
ghcr.io/${{ github.repository }}:${{ (github.ref == 'refs/heads/main' && 'latest') || github.ref_name }}
GLCR_ARM64
:
registry.gitlab.com/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}-arm64v8
GLCR_AMD64
:
registry.gitlab.com/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}-amd64
GLCR_TAG
:
registry.gitlab.com/${{ github.repository }}:${{ github.ref_name }}-${{ github.sha }}
GLCR_BRANCH
:
registry.gitlab.com/${{ github.repository }}:${{ (github.ref == 'refs/heads/main' && 'latest') || github.ref_name }}
DOCKERHUB_TOKEN
:
${{ secrets.DOCKERHUB_TOKEN }}
DOCKERHUB_TOKEN
:
${{ secrets.DOCKERHUB_TOKEN }}
GITLAB_TOKEN
:
${{ secrets.GITLAB_TOKEN }}
steps
:
steps
:
-
name
:
Login to GitHub Container Registry
-
name
:
Login to GitHub Container Registry
uses
:
docker/login-action@v3
uses
:
docker/login-action@v3
...
@@ -250,6 +255,14 @@ jobs:
...
@@ -250,6 +255,14 @@ jobs:
username
:
${{ vars.DOCKER_USERNAME }}
username
:
${{ vars.DOCKER_USERNAME }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
password
:
${{ secrets.DOCKERHUB_TOKEN }}
-
name
:
Login to GitLab Container Registry
if
:
${{ (vars.GITLAB_USERNAME != '') && (env.GITLAB_TOKEN != '') }}
uses
:
docker/login-action@v3
with
:
registry
:
registry.gitlab.com
username
:
${{ vars.GITLAB_USERNAME }}
password
:
${{ secrets.GITLAB_TOKEN }}
-
name
:
Download artifacts
-
name
:
Download artifacts
uses
:
actions/download-artifact@v4
uses
:
actions/download-artifact@v4
...
@@ -264,8 +277,10 @@ jobs:
...
@@ -264,8 +277,10 @@ jobs:
docker load -i oci-image-amd64.tar.gz
docker load -i oci-image-amd64.tar.gz
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_AMD64 }}
docker tag $(docker images -q conduit:main) ${{ env.GLCR_AMD64 }}
docker push ${{ env.DOCKER_AMD64 }}
docker push ${{ env.DOCKER_AMD64 }}
docker push ${{ env.GHCR_AMD64 }}
docker push ${{ env.GHCR_AMD64 }}
docker push ${{ env.GLCR_AMD64 }}
-
name
:
Load and push arm64 image
-
name
:
Load and push arm64 image
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
...
@@ -273,15 +288,22 @@ jobs:
...
@@ -273,15 +288,22 @@ jobs:
docker load -i oci-image-arm64v8.tar.gz
docker load -i oci-image-arm64v8.tar.gz
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.DOCKER_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.GHCR_ARM64 }}
docker tag $(docker images -q conduit:main) ${{ env.GLCR_ARM64 }}
docker push ${{ env.DOCKER_ARM64 }}
docker push ${{ env.DOCKER_ARM64 }}
docker push ${{ env.GHCR_ARM64 }}
docker push ${{ env.GHCR_ARM64 }}
docker push ${{ env.GLCR_ARM64 }}
-
name
:
Create Docker combined manifests
-
name
:
Create Docker combined manifests
run
:
|
run
:
|
# Dockerhub Container Registry
docker manifest create ${{ env.DOCKER_TAG }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
docker manifest create ${{ env.DOCKER_TAG }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
docker manifest create ${{ env.DOCKER_BRANCH }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
docker manifest create ${{ env.DOCKER_BRANCH }} --amend ${{ env.DOCKER_ARM64 }} --amend ${{ env.DOCKER_AMD64 }}
# GitHub Container Registry
docker manifest create ${{ env.GHCR_TAG }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
docker manifest create ${{ env.GHCR_TAG }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
docker manifest create ${{ env.GHCR_BRANCH }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
docker manifest create ${{ env.GHCR_BRANCH }} --amend ${{ env.GHCR_ARM64 }} --amend ${{ env.GHCR_AMD64 }}
# GitLab Container Registry
docker manifest create ${{ env.GLCR_TAG }} --amend ${{ env.GLCR_ARM64 }} --amend ${{ env.GCCR_AMD64 }}
docker manifest create ${{ env.GLCR_BRANCH }} --amend ${{ env.GLCR_ARM64 }} --amend ${{ env.GLCR_AMD64 }}
-
name
:
Push manifests to Docker registries
-
name
:
Push manifests to Docker registries
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
...
@@ -290,9 +312,12 @@ jobs:
...
@@ -290,9 +312,12 @@ jobs:
docker manifest push ${{ env.DOCKER_BRANCH }}
docker manifest push ${{ env.DOCKER_BRANCH }}
docker manifest push ${{ env.GHCR_TAG }}
docker manifest push ${{ env.GHCR_TAG }}
docker manifest push ${{ env.GHCR_BRANCH }}
docker manifest push ${{ env.GHCR_BRANCH }}
docker manifest push ${{ env.GLCR_TAG }}
docker manifest push ${{ env.GLCR_BRANCH }}
-
name
:
Add Image Links to Job Summary
-
name
:
Add Image Links to Job Summary
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
if
:
${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
run
:
|
run
:
|
echo "- \`docker pull ${{ env.DOCKER_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.DOCKER_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.GHCR_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.GHCR_TAG }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`docker pull ${{ env.GLCR_TAG }}\`" >> $GITHUB_STEP_SUMMARY
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
0
−
43
View file @
76126333
...
@@ -127,49 +127,6 @@ artifacts:
...
@@ -127,49 +127,6 @@ artifacts:
-
if
:
$CI
-
if
:
$CI
interruptible
:
true
interruptible
:
true
.push-oci-image
:
stage
:
publish
image
:
docker:26.1.1
services
:
-
docker:26.1.1-dind
variables
:
IMAGE_SUFFIX_AMD64
:
amd64
IMAGE_SUFFIX_ARM64V8
:
arm64v8
script
:
-
docker load -i oci-image-amd64.tar.gz
-
IMAGE_ID_AMD64=$(docker images -q conduit:main)
-
docker load -i oci-image-arm64v8.tar.gz
-
IMAGE_ID_ARM64V8=$(docker images -q conduit:main)
# Tag and push the architecture specific images
-
docker tag $IMAGE_ID_AMD64 $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64
-
docker tag $IMAGE_ID_ARM64V8 $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
-
docker push $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64
-
docker push $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
# Tag the multi-arch image
-
docker manifest create $IMAGE_NAME:$CI_COMMIT_SHA --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
-
docker manifest push $IMAGE_NAME:$CI_COMMIT_SHA
# Tag and push the git ref
-
docker manifest create $IMAGE_NAME:$CI_COMMIT_REF_NAME --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
-
docker manifest push $IMAGE_NAME:$CI_COMMIT_REF_NAME
# Tag git tags as 'latest'
-
|
if [[ -n "$CI_COMMIT_TAG" ]]; then
docker manifest create $IMAGE_NAME:latest --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:latest
fi
dependencies
:
-
artifacts
only
:
-
main
-
tags
oci-image:push-gitlab
:
extends
:
.push-oci-image
variables
:
IMAGE_NAME
:
$CI_REGISTRY_IMAGE/conduwuit
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
pages
:
pages
:
stage
:
publish
stage
:
publish
dependencies
:
dependencies
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment