|
|
|
|
@@ -1,12 +1,7 @@
|
|
|
|
|
name: ci/cd to build and push docker image debian_runner in private registry
|
|
|
|
|
|
|
|
|
|
#https://docs.docker.com/build/ci/github-actions/push-multi-registries/
|
|
|
|
|
#https://www.devsync.se/ci/cd/docker/2023/10/27/gitea-runner-build-docker-containers.html
|
|
|
|
|
|
|
|
|
|
name: ci/cd helm chart
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
tags:
|
|
|
|
|
# Be carefull, conflict with package-deb *.*.*, don't use more than on dot *.* (ex: 2.5-runner)
|
|
|
|
|
- '*-chart'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -25,8 +20,6 @@ jobs:
|
|
|
|
|
steps:
|
|
|
|
|
- name: Show Information
|
|
|
|
|
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
|
|
|
|
# - name: helm create chart
|
|
|
|
|
# run: helm create ${{ env.GIT_REPO }}
|
|
|
|
|
- name: clone repo helm chart
|
|
|
|
|
run: git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ env.GIT_REPO }}
|
|
|
|
|
- name: tag release
|
|
|
|
|
@@ -39,34 +32,3 @@ jobs:
|
|
|
|
|
run: |
|
|
|
|
|
export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
|
|
|
|
curl --user ${{ secrets.REGISTRY_DOCKER_USER }}:${{ secrets.REGISTRY_DOCKER_PASS }} -X POST --upload-file /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}-$VERSION.tgz https://${{ vars.REGISTRY_DOCKER }}/api/packages/${{ secrets.GIT_USER_REPO }}/helm/api/charts
|
|
|
|
|
|
|
|
|
|
# helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm
|
|
|
|
|
# helm cm-push ./{chart_file}.tgz {repo}
|
|
|
|
|
# curl --user {username}:{password} -X POST --upload-file ./{chart_file}.tgz https://gitea.example.com/api/packages/{owner}/helm/api/charts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# - name: Git clone private repository
|
|
|
|
|
# uses: actions/checkout@v4
|
|
|
|
|
# with:
|
|
|
|
|
# repository: ${{ gitea.repository }}
|
|
|
|
|
# token: ${{ secrets.REPO_PULL_GITEA }}
|
|
|
|
|
|
|
|
|
|
# - name: Login to docker private registry
|
|
|
|
|
# uses: docker/login-action@v3
|
|
|
|
|
# with:
|
|
|
|
|
# registry: ${{ vars.REGISTRY_DOCKER }}
|
|
|
|
|
# username: ${{ secrets.REGISTRY_DOCKER_USER }}
|
|
|
|
|
# password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# - run: git --help
|
|
|
|
|
|
|
|
|
|
# - name: Build and push image in registry
|
|
|
|
|
# uses: docker/build-push-action@v5
|
|
|
|
|
# with:
|
|
|
|
|
# context: .
|
|
|
|
|
# push: true
|
|
|
|
|
# tags: ${{ vars.REGISTRY_DOCKER }}/${{ env.CHART_NAME }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ env.CHART_NAME }}:${{ gitea.ref_name }}
|
|
|
|
|
|
|
|
|
|
# - name: Output
|
|
|
|
|
# run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ env.CHART_NAME }} tag ${{ gitea.ref_name }}"
|