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

feat: push images to dockerhub #326

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions .github/workflows/dockerhub-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and push latest images to DockerHub

on:
push:
branches: ["main", "ci-test"]

permissions:
packages: write

jobs:
publish-images-to-dockerhub:
name: Publish to DockerHub
if: ${{ github.repository == 'kubewharf/kubeadmiral' }}
runs-on: [ubuntu-latest]
steps:
- name: checkout code
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER_NAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and publish images
env:
REGISTRY: kubewharf
TAG: latest
run: make upload-images
30 changes: 30 additions & 0 deletions .github/workflows/dokcerhub-released.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and push released images to DockerHub

on:
release:
types:
- published

permissions:
packages: write

jobs:
publish-images-to-dockerhub:
name: Publish to DockerHub
if: ${{ github.repository == 'kubewharf/kubeadmiral' }}
runs-on: [ubuntu-latest]
steps:
- name: checkout code
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER_NAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and publish images
env:
REGISTRY: kubewharf
TAG: ${{ github.ref_name }}
run: make upload-images
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,8 @@ test:
.PHONY: e2e
e2e:
ginkgo run -race -tags=e2e $(EXTRA_GINKGO_FLAGS) test/e2e -- --kubeconfig=$(KUBECONFIG) $(EXTRA_E2E_FLAGS)

upload-images: images
@echo "push images to $(REGISTRY)"
docker push ${REGISTRY}/kubeadmiral-controller-manager:${TAG}
docker push ${REGISTRY}/kubeadmiral-hpa-aggregator:${TAG}
Loading