name: release on: push: branches: [main] tags: ["v*"] schedule: - cron: "0 3 1 * *" workflow_dispatch: permissions: contents: read packages: write concurrency: group: release cancel-in-progress: false env: REGISTRY: git.fristy.net IMAGE: git.fristy.net/actions/runner-images jobs: meta: runs-on: ubuntu-latest outputs: created: ${{ steps.meta.outputs.created }} version: ${{ steps.meta.outputs.version }} steps: - name: Get meta id: meta run: | echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" if [ "${GITHUB_REF_TYPE}" = "tag" ]; then version="${GITHUB_REF_NAME}" else version="v0.0.0-dev.$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" fi echo "version=${version}" >> "$GITHUB_OUTPUT" publish: needs: meta runs-on: ubuntu-latest timeout-minutes: 120 strategy: fail-fast: false matrix: include: - base: "24.04" tags: ubuntu-24.04 - base: "26.04" tags: ubuntu-26.04 - base: "26.10" tags: ubuntu-26.10,ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - name: Log in to the registry run: | token="${{ secrets.REGISTRY_TOKEN }}" [ -n "$token" ] || { echo "REGISTRY_TOKEN secret is missing" >&2; exit 1; } echo "$token" | docker login "$REGISTRY" -u "${{ secrets.REGISTRY_USERNAME || github.actor }}" --password-stdin - name: Build and push ${{ matrix.base }} uses: docker/build-push-action@v7 with: context: . file: dockerfiles/ubuntu.dockerfile platforms: linux/amd64 pull: true push: true tags: | ${{ env.IMAGE }}:${{ matrix.tags }} ${{ env.IMAGE }}:${{ needs.meta.outputs.version }}-${{ matrix.base }} cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache-${{ matrix.base }} cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache-${{ matrix.base }},mode=max build-args: | BASE_IMAGE_TAG=${{ matrix.base }} IMAGE_CREATED=${{ needs.meta.outputs.created }} IMAGE_VERSION=${{ needs.meta.outputs.version }} IMAGE_REVISION=${{ github.sha }} - name: Smoke test the published image run: | docker pull "${IMAGE}:ubuntu-${{ matrix.base }}" docker run --rm -i "${IMAGE}:ubuntu-${{ matrix.base }}" bash -s -- ${{ matrix.base }} < tests/default.sh