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