Update containerization apple main (#4)

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
Kathryn Baldauf
2025-06-05 16:15:44 -07:00
parent 74dd129094
commit 502dab6108
34 changed files with 4889 additions and 336 deletions
+62
View File
@@ -0,0 +1,62 @@
name: Build and publish containerization test images
on:
workflow_dispatch:
inputs:
publish:
type: boolean
description: "Publish the built image"
default: false
version:
type: string
description: "Version of the image to create"
default: "test"
image:
type: choice
description: Test image to build
options:
- dockermanifestimage
- emptyimage
default: 'dockermanifestimage'
useBuildx:
type: boolean
description: "Use docker buildx to build the image"
default: false
jobs:
image:
name: Build test images
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check inputs
run: |
if [ ${{ inputs.image }} == 'dockermanifestimage' ] && [ ${{ inputs.useBuildx }} == true ]; then
echo "dockermanifestimage cannot be built with buildx"
exit 1
fi
if [ ${{ inputs.image }} == 'emptyimage' ] && [ ${{ inputs.useBuildx}} != true ]; then
echo "emptyimage should be built with buildx"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
if: ${{ inputs.useBuildx }}
uses: docker/setup-buildx-action@v3
- name: Build dockerfile and push image
uses: docker/build-push-action@v6
with:
push: ${{ inputs.publish }}
context: Tests/TestImages/${{ inputs.image }}
tags: ghcr.io/apple/containerization/${{ inputs.image }}:${{ inputs.version }}
@@ -69,8 +69,8 @@ jobs:
- name: Push vminitd image
if: ${{ inputs.release }}
run: |
bin/cctl images tag vminit:latest ghcr.io/apple-uat/containerization/vminit:${{ inputs.version }}
bin/cctl images push ghcr.io/apple-uat/containerization/vminit:${{ inputs.version }}
bin/cctl images tag vminit:latest ghcr.io/apple/containerization/vminit:${{ inputs.version }}
bin/cctl images push ghcr.io/apple/containerization/vminit:${{ inputs.version }}
env:
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REGISTRY_USERNAME: ${{ github.actor }}
+14 -5
View File
@@ -1,22 +1,31 @@
# Manual workflow for releasing docs ad-hoc. Workflow can only be run for main or release branches.
# Workflow does NOT publish a release of containerization.
name: Deploy application website
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
permissions:
contents: read
packages: write
pages: write
jobs:
checkBranch:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'ref/heads/release')
steps:
- name: Branch validation
run: echo "Branch ${{ github.ref_name }} is allowed"
buildSite:
name: Build application website
needs: checkBranch
uses: ./.github/workflows/containerization-build-template.yml
secrets: inherit
deploy:
deployDocs:
runs-on: ubuntu-latest
needs: buildSite
needs: [checkBranch, buildSite]
environment:
name: github-pages
+44 -4
View File
@@ -5,13 +5,53 @@ on:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: read
packages: write
pages: write
jobs:
containerization:
permissions:
contents: read
packages: write
uses: ./.github/workflows/containerization-build-template.yml
with:
release: true
version: ${{ github.ref_name }}
version: ${{ github.ref_name }}
secrets: inherit
deployDocs:
runs-on: ubuntu-latest
needs: containerization
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
name: Publish release
timeout-minutes: 30
needs: containerization
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Package sources
run: |
mkdir -p outputs
tar --exclude="./outputs" -czf outputs/sources.tar.gz .
- name: Create release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}-prerelease
draft: true
make_latest: false
prerelease: true
fail_on_unmatched_files: true
files: |
outputs/sources.tar.gz