Compare commits
10 Commits
0.1.0
..
6a9cefbaf3
| Author | SHA1 | Date | |
|---|---|---|---|
|
6a9cefbaf3
|
|||
|
cc32a01246
|
|||
|
9b0d6a3279
|
|||
|
4f6910c809
|
|||
|
d926b3b4b1
|
|||
|
dff5b5c9a1
|
|||
|
2753647d01
|
|||
|
90d21f1dd8
|
|||
|
93fd4e89d5
|
|||
|
0d160b5f08
|
@@ -1,7 +0,0 @@
|
|||||||
*
|
|
||||||
|
|
||||||
!pkg
|
|
||||||
!controller.go
|
|
||||||
!main.go
|
|
||||||
!go.mod
|
|
||||||
!go.sum
|
|
||||||
@@ -14,3 +14,4 @@ runs:
|
|||||||
id: hash-go
|
id: hash-go
|
||||||
run: |
|
run: |
|
||||||
echo "hash=$(sha256sum go.mod go.sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
|
echo "hash=$(sha256sum go.mod go.sum | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "hash=$hash" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
name: CD
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- "go.mod"
|
|
||||||
- "go.sum"
|
|
||||||
- "**/*.go"
|
|
||||||
- "Dockerfile"
|
|
||||||
- "Makefile"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
DOCKER_REGISTRY: gitea.t000-n.de
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_and_push:
|
|
||||||
name: Build and push
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch: [amd64]
|
|
||||||
runs-on:
|
|
||||||
- ubuntu-latest
|
|
||||||
- linux_${{ matrix.arch }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
||||||
- name: Login to Registry
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
registry: ${{ env.DOCKER_REGISTRY }}
|
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
- name: Get Metadata
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
|
|
||||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
platforms: linux/${{ matrix.arch }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
build-args: GOARCH=${{ matrix.arch }}
|
|
||||||
tags: |
|
|
||||||
${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }}
|
|
||||||
|
|
||||||
create_tag:
|
|
||||||
name: Create tag
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
tag: ${{ steps.tag.outputs.new-tag }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@ef0c23189db33220a73022d8c29a27709d0df440 # 0.1.32
|
|
||||||
id: tag
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
prerelease: ${{ github.event_name == 'workflow_dispatch' }}
|
|
||||||
- run: |
|
|
||||||
git tag ${{ steps.tag.outputs.new-tag }}
|
|
||||||
git push origin ${{ steps.tag.outputs.new-tag }}
|
|
||||||
- name: Set output
|
|
||||||
run: |
|
|
||||||
echo "tag=${{ steps.tag.outputs.new-tag }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
create_manifest:
|
|
||||||
name: Create manifest
|
|
||||||
needs:
|
|
||||||
- build_and_push
|
|
||||||
- create_tag
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
|
|
||||||
- name: Get Metadata
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
|
|
||||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Login to Registry
|
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
||||||
with:
|
|
||||||
registry: ${{ env.DOCKER_REGISTRY }}
|
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Create manifest
|
|
||||||
run: |
|
|
||||||
docker manifest create ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ needs.create_tag.outputs.tag }} \
|
|
||||||
${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-amd64
|
|
||||||
|
|
||||||
docker manifest push ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ needs.create_tag.outputs.tag }}
|
|
||||||
@@ -9,33 +9,64 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install-dependencies:
|
install-dependencies:
|
||||||
uses: ./.gitea/workflows/install-go-dependencies.yaml
|
name: install dependencies
|
||||||
|
runs-on:
|
||||||
|
- ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Install dependencies
|
||||||
|
uses: .gitea/workflows/install-go-dependencies
|
||||||
|
|
||||||
build-check:
|
build-check:
|
||||||
name: build check
|
name: build check
|
||||||
|
runs-on:
|
||||||
|
- ubuntu-latest
|
||||||
needs: install-dependencies
|
needs: install-dependencies
|
||||||
uses: ./.gitea/workflows/run-go-script.yaml
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Run build script
|
||||||
|
uses: .gitea/workflows/run-go-script
|
||||||
with:
|
with:
|
||||||
script: build
|
script: build
|
||||||
|
|
||||||
check-format:
|
check-format:
|
||||||
name: check format
|
name: check format
|
||||||
needs: install-dependencies
|
runs-on:
|
||||||
uses: ./.gitea/workflows/run-go-script.yaml
|
- ubuntu-latest
|
||||||
|
needs: build-check
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Run check format script
|
||||||
|
uses: .gitea/workflows/run-go-script
|
||||||
with:
|
with:
|
||||||
script: check-format
|
script: check-format
|
||||||
|
|
||||||
check-lint:
|
check-lint:
|
||||||
name: check lint
|
name: check lint
|
||||||
needs: install-dependencies
|
runs-on:
|
||||||
uses: ./.gitea/workflows/run-go-script.yaml
|
- ubuntu-latest
|
||||||
|
needs: build-check
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Run check lint script
|
||||||
|
uses: .gitea/workflows/run-go-script
|
||||||
with:
|
with:
|
||||||
script: lint
|
script: check-lint
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: test
|
name: test
|
||||||
needs: install-dependencies
|
runs-on:
|
||||||
uses: ./.gitea/workflows/run-go-script.yaml
|
- ubuntu-latest
|
||||||
|
needs: build-check
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Run test script
|
||||||
|
uses: .gitea/workflows/run-go-script
|
||||||
with:
|
with:
|
||||||
script: test
|
script: test
|
||||||
|
|
||||||
@@ -44,6 +75,7 @@ jobs:
|
|||||||
runs-on:
|
runs-on:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- linux_amd64
|
- linux_amd64
|
||||||
|
needs: build-check
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|||||||
@@ -5,20 +5,17 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install-dependencies:
|
install-dependencies:
|
||||||
runs-on:
|
runs-on: ubuntu-latest
|
||||||
- ubuntu-latest
|
|
||||||
- linux_amd64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0.4.0
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Create cache key
|
- name: Create cache key
|
||||||
id: go-cache-key
|
uses: .gitea/actions/go-cache-key@main
|
||||||
uses: ./.gitea/actions/go-cache-key
|
|
||||||
- name: cache go
|
- name: cache go
|
||||||
id: cache-go
|
id: cache-go
|
||||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||||
@@ -26,8 +23,6 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
/go_path
|
/go_path
|
||||||
/go_cache
|
/go_cache
|
||||||
key: go_path-${{ steps.go-cache-key.outputs.hash }}
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
restore-keys: |-
|
restore-keys: |-
|
||||||
go_cache-${{ steps.go-cache-key.outputs.hash }}
|
go_cache-${{ steps.hash-go.outputs.hash }}
|
||||||
- name: Download dependencies
|
|
||||||
run: go mod download
|
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-script:
|
run-script:
|
||||||
runs-on:
|
runs-on: ubuntu-latest
|
||||||
- ubuntu-latest
|
|
||||||
- linux_amd64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
@@ -22,8 +20,7 @@ jobs:
|
|||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Create cache key
|
- name: Create cache key
|
||||||
id: go-cache-key
|
uses: .gitea/actions/go-cache-key@main
|
||||||
uses: ./.gitea/actions/go-cache-key
|
|
||||||
- name: Install dependencies from Cache
|
- name: Install dependencies from Cache
|
||||||
id: cache-go
|
id: cache-go
|
||||||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||||||
@@ -31,8 +28,8 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
/go_path
|
/go_path
|
||||||
/go_cache
|
/go_cache
|
||||||
key: go_path-${{ steps.go-cache-key.outputs.hash }}
|
key: go_path-${{ steps.hash-go.outputs.hash }}
|
||||||
restore-keys: |-
|
restore-keys: |-
|
||||||
go_cache-${{ steps.go-cache-key.outputs.hash }}
|
go_cache-${{ steps.hash-go.outputs.hash }}
|
||||||
- name: Run script
|
- name: Run script
|
||||||
run: make ${{ inputs.script }}
|
run: make ${{ inputs.script }}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/golang:1.26.3@sha256:313faae491b410a35402c05d35e7518ae99103d957308e940e1ae2cfa0aac29b AS build
|
FROM docker.io/library/golang:1.25-alpine@sha256:04d017a27c481185c169884328a5761d052910fdced8c3b8edd686474efdf59b AS build
|
||||||
|
|
||||||
ARG GOARCH=amd64
|
ARG GOARCH=amd64
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user