First commit.

This commit is contained in:
Pieter Hollander 2023-12-05 17:37:50 +01:00
commit 5801910be2
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg
9 changed files with 473 additions and 0 deletions
.gitea/workflows

View file

@ -0,0 +1,58 @@
name: Build Docker image
run-name: ${{ gitea.actor }} is building a new image 🚀
on:
# schedule:
# - cron: "0 10 * * *"
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-docker
steps:
- name: echo job info
run: echo "🎉 This job was automatically triggered by a ${{ gitea.event_name }} event and running on a ${{ runner.os }} repo:branch:${{ gitea.repository }}:${{ gitea.ref }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate image tags
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
git.hollander.online/${{ gitea.repository_owner }}/${{ gitea.event.repository.name }}
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to registry
if: gitea.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: git.hollander.online
username: ${{ gitea.repository_owner }}
password: ${{ secrets.CI_PACKAGES_RW }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64,linux/amd64
- name: Cleanup old images
run: docker system prune -f

28
.gitea/workflows/go.yml Normal file
View file

@ -0,0 +1,28 @@
# # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
# # https://github.com/goreleaser/goreleaser-action
# name: Release Go package
# on: [push]
# jobs:
# build:
# runs-on: ubuntu-docker
# strategy:
# matrix:
# go-version: [ '1.21' ]
# steps:
# - uses: actions/checkout@v4
# # - name: Setup Go ${{ matrix.go-version }}
# # uses: actions/setup-go@v4
# # with:
# # go-version: ${{ matrix.go-version }}
# # # You can test your matrix by printing the current Go version
# - name: Display Go version
# run: go version
# - name: Run GoReleaser
# uses: goreleaser/goreleaser-action@master
# with:
# version: latest
# args: release --rm-dist