Initial version

This commit is contained in:
2025-08-28 13:00:38 -04:00
commit 5cfb879462

View File

@@ -0,0 +1,77 @@
name: Build and Publisch a Simple Container
on:
workflow_call:
inputs:
package-name:
required: true
type: string
package-label:
required: true
type: string
builder-image:
required: false
type: string
default: gitea.ampenberger.com/campenbe/img-builder:3.21-1.24
secrets:
PASSWORD:
required: true
GIT_TOKEN:
required: true
env:
PACKAGE_NAME: ${{ inputs.package-name }}
LABEL: ${{ inputs.package-label }}
ARTIFACT_UPLOAD: ${{ env.ACT_EXEC == 'true' && 'actions/upload-artifact@v2' || 'actions/upload-artifact@v3' }}
ARTIFACT_DOWNLOAD: ${{ env.ACT_EXEC == 'true' && 'actions/download-artifact@v2' || 'actions/download-artifact@v3' }}
BUILDER_IMAGE: ${{ inputs.builder-image }}
jobs:
container:
runs-on: ubuntu-latest
container:
image: ${{env.BUILDER_IMAGE}}
credentials:
username: campenbe
password: ${{secrets.PASSWORD}}
steps:
- name: Install tools
run : |
gitea_addr.sh
env | sort
- name: Fix git access
run: |
git config --global url."https://git:${{secrets.GIT_TOKEN}}@gitea.ampenberger.com/campenbe/.insteadOf" git://git.ampenberger.com/
- uses: actions/checkout@v4
with:
submodules: false
- name: Build container
run: |
buildah build -f Dockerfile -t gitea.ampenberger.com/campenbe/${PACKAGE_NAME}:${LABEL}
echo "Built ${PACKAGE_NAME}:${LABEL}"
buildah images
- name: export the image
run: |
buildah push --format docker gitea.ampenberger.com/campenbe/${PACKAGE_NAME}:${LABEL} docker-archive:${PACKAGE_NAME}-${LABEL}.tar
echo "Exported gitea.ampenberger.com/campenbe/${PACKAGE_NAME}:${LABEL} to ${PACKAGE_NAME}-${LABEL}.tar"
- name: Upload container image
uses: "${{env.ARTIFACT_UPLOAD}}"
with:
name: ${{env.PACKAGE_NAME}}-${{ env.LABEL }}
path: "${{env.PACKAGE_NAME}}-${{ env.LABEL }}.tar"
if-no-files-found: error
compression-level: 0
- name: Publish the container to the registry
run: |
buildah login -u campenbe -p ${{secrets.GIT_TOKEN}} gitea.ampenberger.com
buildah push gitea.ampenberger.com/campenbe/${PACKAGE_NAME}:${LABEL}