Compare commits

..

4 Commits

Author SHA1 Message Date
75bf25d041 [test build push docker image] 2024-11-23 17:50:51 +01:00
20e2b5d51b [test runner] 2024-11-23 17:43:18 +01:00
11dcd2625a [test runner] 2024-11-23 17:38:57 +01:00
0649fece72 [test runner] 2024-11-23 17:38:15 +01:00
2 changed files with 29 additions and 18 deletions

View File

@@ -13,7 +13,7 @@ jobs:
# container: debian:bullseye # container: debian:bullseye
# runs-on: ubuntu-latest # runs-on: ubuntu-latest
# container: node:16-bullseye # container: node:16-bullseye
runs-on: debian-runner runs-on: docker
container: container:
image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest
credentials: credentials:

View File

@@ -11,14 +11,14 @@ on:
jobs: jobs:
build-and-push-debian-runner: build-and-push-debian-runner:
# see on runner /data/.runner to add label (test => test:docker://debian:bullseye) #! see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
# runs-on: test # runs-on: test
# container: debian:bullseye # container: debian:bullseye
# runs-on: ubuntu-latest # runs-on: ubuntu-latest
# container: node:16-bullseye # container: node:16-bullseye
runs-on: ubuntu-runner runs-on: ubuntu-runner
container: container:
image: docker:dind image: docker
# container: # container:
# image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest # image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest
# credentials: # credentials:
@@ -29,6 +29,17 @@ jobs:
steps: steps:
- name: Show Information - name: Show Information
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}" run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
- name: login & clone & build & push
run: |
echo "${{ secrets.REGISTRY_DOCKER_PASS }}" | docker login -u ${{ secrets.REGISTRY_DOCKER_USER }} --password-stdin ${{ vars.REGISTRY_DOCKER }}
git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ vars.DOCKER_IMAGE_NAME }}
cd ${{ vars.DOCKER_IMAGE_NAME }}
docker buildx b . -t ${{ vars.DOCKER_IMAGE_NAME }}
docker tag ${{ vars.DOCKER_IMAGE_NAME }} ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}
docker push ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ gitea.ref_name }}
docker push ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:latest
# - name: Git clone private repository # - name: Git clone private repository
# uses: actions/checkout@v4 # uses: actions/checkout@v4
@@ -36,22 +47,22 @@ jobs:
# repository: ${{ gitea.repository }} # repository: ${{ gitea.repository }}
# token: ${{ secrets.REPO_PULL_GITEA }} # token: ${{ secrets.REPO_PULL_GITEA }}
- name: Login to docker private registry # - name: Login to docker private registry
uses: docker/login-action@v3 # uses: docker/login-action@v3
with: # with:
registry: ${{ vars.REGISTRY_DOCKER }} # registry: ${{ vars.REGISTRY_DOCKER }}
username: ${{ secrets.REGISTRY_DOCKER_USER }} # username: ${{ secrets.REGISTRY_DOCKER_USER }}
password: ${{ secrets.REGISTRY_DOCKER_PASS }} # password: ${{ secrets.REGISTRY_DOCKER_PASS }}
- run: git --help # - run: git --help
- name: Build and push image in registry # - name: Build and push image in registry
uses: docker/build-push-action@v5 # uses: docker/build-push-action@v5
with: # with:
context: . # context: .
push: true # push: true
tags: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ gitea.ref_name }} # tags: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }}:${{ gitea.ref_name }}
- name: Output # - name: Output
run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ vars.DOCKER_IMAGE_NAME }} tag ${{ gitea.ref_name }}" # run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ vars.DOCKER_IMAGE_NAME }} tag ${{ gitea.ref_name }}"