From c3a9aa2a2e5c3dc9edc36f6b4cef2c65264dbec6 Mon Sep 17 00:00:00 2001 From: Martin McCaffery Date: Wed, 17 Dec 2025 16:55:09 +0100 Subject: [PATCH] feat(deployment): add build workflow yaml --- .github/workflows/build.yaml | 66 ++++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 6 ++-- .github/workflows/release.yaml | 22 ++++++------ .github/workflows/test.yml | 8 ++--- 4 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..06ceb91 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,66 @@ +name: build + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Load versions from .env.versions + id: versions + run: | + set -a + source .env.versions + set +a + + echo "node_version=${NODE_VERSION}" >> "$GITHUB_OUTPUT" + echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT" + echo "hugo_version=${HUGO_VERSION}" >> "$GITHUB_OUTPUT" + + echo "Node: ${NODE_VERSION}" + echo "Go: ${GO_VERSION}" + echo "Hugo: ${HUGO_VERSION}" + + - name: Repository meta + id: repository + run: | + registry=${{ github.server_url }} + registry=${registry##http*://} + echo "registry=${registry}" >> "$GITHUB_OUTPUT" + echo "registry=${registry}" + repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" + echo "repository=${repository}" >> "$GITHUB_OUTPUT" + echo "repository=${repository}" + + - name: Docker meta + uses: docker/metadata-action@v5 + id: docker + with: + images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }} + tags: | + type=sha,prefix= + type=ref,event=tag + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + allow: network.host + network: host + tags: ${{ steps.docker.outputs.tags }} + labels: ${{ steps.docker.outputs.labels }} + build-args: | + NODE_VERSION=${{ steps.versions.outputs.node_version }} + GO_VERSION=${{ steps.versions.outputs.go_version }} + HUGO_VERSION=${{ steps.versions.outputs.hugo_version }} + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae56f2a..79e82b0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,7 +1,7 @@ name: ci on: - push: +# push: workflow_dispatch: jobs: @@ -22,11 +22,11 @@ jobs: set -a source .env.versions set +a - + echo "node_version=${NODE_VERSION}" >> "$GITHUB_OUTPUT" echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT" echo "hugo_version=${HUGO_VERSION}" >> "$GITHUB_OUTPUT" - + echo "Node: ${NODE_VERSION}" echo "Go: ${GO_VERSION}" echo "Hugo: ${HUGO_VERSION}" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8168687..50db5ca 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,11 +26,11 @@ jobs: set -a source .env.versions set +a - + echo "node_version=${NODE_VERSION}" >> "$GITHUB_OUTPUT" echo "go_version=${GO_VERSION}" >> "$GITHUB_OUTPUT" echo "hugo_version=${HUGO_VERSION}" >> "$GITHUB_OUTPUT" - + echo "Node: ${NODE_VERSION}" echo "Go: ${GO_VERSION}" echo "Hugo: ${HUGO_VERSION}" @@ -100,7 +100,7 @@ jobs: run: | # Finde vorheriges Tag PREVIOUS_TAG=$(git describe --abbrev=0 --tags ${GITHUB_REF}^ 2>/dev/null || echo "") - + if [ -z "$PREVIOUS_TAG" ]; then echo "Erster Release - Changelog von Anfang an" CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges) @@ -108,7 +108,7 @@ jobs: echo "Changelog seit ${PREVIOUS_TAG}" CHANGELOG=$(git log ${PREVIOUS_TAG}..${GITHUB_REF} --pretty=format:"- %s (%h)" --no-merges) fi - + # Schreibe in Output-Datei (multiline) { echo 'changelog<