feat: Initial act-runner-extended container image
This commit is contained in:
126
.gitea/workflows/actions.yaml
Normal file
126
.gitea/workflows/actions.yaml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
name: build-image
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
semrel_dryrun:
|
||||||
|
name: Semantic Release (Dry-run)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.sem_rel.outputs.version }}
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm install \
|
||||||
|
semantic-release \
|
||||||
|
@semantic-release/commit-analyzer \
|
||||||
|
@semantic-release/exec
|
||||||
|
- name: Semantic Release (dry-run)
|
||||||
|
id: sem_rel
|
||||||
|
run: |
|
||||||
|
npx semantic-release \
|
||||||
|
--package @semantic-release/exec \
|
||||||
|
--package semantic-release \
|
||||||
|
--branches ${{ gitea.refname }} \
|
||||||
|
--tag-format 'v${version}' \
|
||||||
|
--dry-run \
|
||||||
|
--plugins @semantic-release/commit-analyzer,@semantic-release/exec \
|
||||||
|
--analyzeCommits @semantic-release/commit-analyzer \
|
||||||
|
--verifyRelease @semantic-release/exec \
|
||||||
|
--verifyReleaseCmd 'echo "version=${nextRelease.version}" >> $GITHUB_OUTPUT'
|
||||||
|
- name: Assert semantic release output
|
||||||
|
run: |
|
||||||
|
[[ -z "${{ steps.sem_rel.outputs.version }}" ]] && {
|
||||||
|
echo 'No release tag - exiting'; exit 1
|
||||||
|
} || {
|
||||||
|
echo 'Release tag set correctly: ${{ steps.sem_rel.outputs.version }}'; exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
build_container:
|
||||||
|
name: Container image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: semrel_dryrun
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Create builder context
|
||||||
|
id: buildx-context
|
||||||
|
run: |
|
||||||
|
docker context create builders
|
||||||
|
- name: Set up buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
endpoint: builders
|
||||||
|
- name: Login to target repository
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: code.spamasaurus.com
|
||||||
|
username: ${{ secrets.GIT_USERNAME }}
|
||||||
|
password: ${{ secrets.GIT_APIKEY }}
|
||||||
|
- name: Extract source image version tag
|
||||||
|
id: source_tag
|
||||||
|
run: |
|
||||||
|
tag=$(grep FROM Dockerfile | head -n1 | sed -n 's/.*v\([0-9]\{2\}\)\.\([0-9]\{2\}\)\.\([0-9]\{2\}\).*/\1\2\3/p')
|
||||||
|
echo "cthtag=cth$tag" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: Build & push container image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
tags: code.spamasaurus.com/djpbessems/act-runner-extended:${{ needs.semrel_dryrun.outputs.version }}-cth-{{ ${{ steps.source_tag.outputs.cthtag }} }}
|
||||||
|
provenance: false
|
||||||
|
push: true
|
||||||
|
|
||||||
|
# build_chart:
|
||||||
|
# name: Helm chart
|
||||||
|
# runs-on: dind-rootless
|
||||||
|
# needs: semrel_dryrun
|
||||||
|
# steps:
|
||||||
|
# - name: Check out repository code
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# - uses: azure/setup-helm@v4.2.0
|
||||||
|
# id: setup
|
||||||
|
# with:
|
||||||
|
# version: "latest"
|
||||||
|
# - name: Prepare build environment
|
||||||
|
# run: |
|
||||||
|
# helm plugin install https://github.com/chartmuseum/helm-push
|
||||||
|
|
||||||
|
# sed -i 's/{{ chart_version }}/${{ needs.semrel_dryrun.outputs.version }}/g' charts/json-server/Chart.yaml
|
||||||
|
# sed -i 's/{{ image_tag }}/${{ needs.semrel_dryrun.outputs.version }}/g' charts/json-server/values.yaml
|
||||||
|
# - name: Build & push helm chart
|
||||||
|
# run: |
|
||||||
|
# helm package ./charts/json-server
|
||||||
|
# helm repo add \
|
||||||
|
# --username ${{ secrets.GIT_USERNAME }} \
|
||||||
|
# --password ${{ secrets.GIT_APIKEY }} \
|
||||||
|
# spamasaurus \
|
||||||
|
# https://code.spamasaurus.com/api/packages/${{ secrets.GIT_USERNAME }}/helm
|
||||||
|
# helm cm-push \
|
||||||
|
# json-server-*.tgz \
|
||||||
|
# spamasaurus
|
||||||
|
|
||||||
|
semrel:
|
||||||
|
name: Semantic Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build_container,build_chart]
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
npm install \
|
||||||
|
semantic-release \
|
||||||
|
@semantic-release/changelog \
|
||||||
|
@semantic-release/commit-analyzer \
|
||||||
|
@semantic-release/git \
|
||||||
|
@semantic-release/release-notes-generator
|
||||||
|
- name: Semantic Release
|
||||||
|
run: |
|
||||||
|
npx semantic-release \
|
||||||
|
--branches ${{ gitea.refname }} \
|
||||||
|
--tag-format 'v${version}' \
|
||||||
|
--plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator,@semantic-release/changelog,@semantic-release/git
|
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# FROM gitea/act_runner:ubuntu-24.04-v25.08.01
|
||||||
|
FROM catthehacker/ubuntu:act-24.04-20250815 AS source
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
gettext \
|
||||||
|
genisoimage \
|
||||||
|
libguestfs-tools \
|
||||||
|
qemu-system-x86 \
|
||||||
|
qemu-utils \
|
||||||
|
supermin && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
Reference in New Issue
Block a user