Move docker to gitea actiob

This commit is contained in:
sclement 2024-05-03 11:12:10 +02:00
parent 8894670e8b
commit 38fd66430b
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
2 changed files with 91 additions and 43 deletions

View File

@ -0,0 +1,48 @@
name: ci
on:
push:
branches:
- "master"
tags:
- "*"
pull_request:
branches:
- "master"
jobs:
docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
git.sebclem.fr/${{ gitea.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to registry
if: "!startsWith('renovate/', github.ref_name)"
uses: docker/login-action@v3
with:
registry: git.sebclem.fr
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ !startsWith('renovate/', github.ref_name) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,45 +1,45 @@
when:
event:
- push
- manual
# when:
# event:
# - push
# - manual
steps:
build-only:
image: woodpeckerci/plugin-docker-buildx
settings:
repo: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
cache_from: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
registry: git.sebclem.fr
dry_run: true
logins:
- registry: https://git.sebclem.fr
username:
from_secret: docker_user
password:
from_secret: docker_token
when:
- event: push
branch: renovate/*
- event: manual
branch: renovate/*
# steps:
# build-only:
# image: woodpeckerci/plugin-docker-buildx
# settings:
# repo: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
# cache_from: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
# registry: git.sebclem.fr
# dry_run: true
# logins:
# - registry: https://git.sebclem.fr
# username:
# from_secret: docker_user
# password:
# from_secret: docker_token
# when:
# - event: push
# branch: renovate/*
# - event: manual
# branch: renovate/*
publish-dev:
image: woodpeckerci/plugin-docker-buildx
settings:
repo: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
cache_from: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
registry: git.sebclem.fr
tag: ${CI_COMMIT_BRANCH}
logins:
- registry: https://git.sebclem.fr
username:
from_secret: docker_user
password:
from_secret: docker_token
when:
- event: push
branch:
exclude: renovate/*
- event: manual
branch:
exclude: renovate/*
# publish-dev:
# image: woodpeckerci/plugin-docker-buildx
# settings:
# repo: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
# cache_from: git.sebclem.fr/sebclem/${CI_REPO_NAME,,}
# registry: git.sebclem.fr
# tag: ${CI_COMMIT_BRANCH}
# logins:
# - registry: https://git.sebclem.fr
# username:
# from_secret: docker_user
# password:
# from_secret: docker_token
# when:
# - event: push
# branch:
# exclude: renovate/*
# - event: manual
# branch:
# exclude: renovate/*