52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
name: ci/cd to build and push docker image wafwoof in private registry
|
|
|
|
env:
|
|
GIT_REPO: staffadmin/wafw00f
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
# Be carefull, conflict with package-deb *.*.*, don't use more than on dot *.* (ex: 2.5-runner)
|
|
- '*-waf'
|
|
|
|
jobs:
|
|
build-and-push-debian-runner:
|
|
# see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
|
|
# runs-on: test
|
|
# container: debian:bullseye
|
|
# runs-on: ubuntu-latest
|
|
# container: node:16-bullseye
|
|
runs-on: debian-runner
|
|
container:
|
|
image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest
|
|
credentials:
|
|
username: ${{ secrets.REGISTRY_DOCKER_USER }}
|
|
password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
|
|
|
|
|
steps:
|
|
- name: Show Information
|
|
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
|
|
|
- name: Git clone private repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: ${{ env.GIT_REPO }}
|
|
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 }}
|
|
|
|
- name: Build and push image in registry
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_WAFWOOF }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_WAFWOOF }}:${{ gitea.ref_name }}
|
|
|
|
- name: Output
|
|
run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ vars.DOCKER_IMAGE_WAFWOOF }} tag ${{ gitea.ref_name }}" |