git-trees-oras #899
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: git-trees-oras | |
| on: | |
| schedule: | |
| - cron: '0 1 * * *' # Scheduled runs every day at 1am UTC | |
| workflow_dispatch: | |
| jobs: | |
| git-trees: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| packages: write | |
| steps: | |
| - name: Free Github Runner | |
| uses: descriptinc/free-disk-space@main | |
| with: | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - name: Docker Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} # GitHub username or org | |
| password: ${{ secrets.GITHUB_TOKEN }} # GitHub actions builtin token. repo has to have pkg access. | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Keep alive | |
| uses: liskin/gh-workflow-keepalive@v1 | |
| - name: Test ORAS, Tokens, Logins, etc | |
| env: | |
| TARGET_OCI: "ghcr.io/${{ github.repository }}/kernel-git-oras-validation:latest" | |
| TARGET_FULL_FILE_PATH: "/tmp/test_oras/test.txt" | |
| run: | | |
| mkdir -p "/tmp/test_oras" | |
| date > "${TARGET_FULL_FILE_PATH}" | |
| bash oras_upload.sh | |
| - name: Cache git worktree | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/workdir/kernel/worktree | |
| key: ${{ runner.os }}-kernel-worktree-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-kernel-worktree | |
| - name: Prepare git trees, bulk of work, slow | |
| run: | | |
| BASE_WORK_DIR="/tmp/workdir" bash work_kernel_tree.sh | |
| - name: Upload multiple shallow trees to ghcr.io via ORAS | |
| env: | |
| TARGET_OCI_PREFIX: "ghcr.io/${{ github.repository }}/kernel-git-shallow" # :latest | |
| OUTPUT_BASE: "/tmp/workdir/kernel/output_oras" | |
| run: | | |
| for KERNEL_VERSION in $(cat ${OUTPUT_BASE}/shallow_versions.txt); do | |
| echo "::group::Pushing ORAS bundle for shallow ${KERNEL_VERSION}" | |
| echo "version: $KERNEL_VERSION" | |
| export TARGET_OCI="${TARGET_OCI_PREFIX}-${KERNEL_VERSION}:latest" | |
| export TARGET_FULL_FILE_PATH="${OUTPUT_BASE}/linux-shallow-${KERNEL_VERSION}.git.tar" | |
| echo "TARGET_OCI: ${TARGET_OCI}" | |
| echo "TARGET_FULL_FILE_PATH: ${TARGET_FULL_FILE_PATH}" | |
| bash oras_upload.sh | |
| echo "::endgroup::" | |
| done | |
| - name: Upload single complete tree to ghcr.io via ORAS | |
| env: | |
| TARGET_OCI: "ghcr.io/${{ github.repository }}/kernel-git:latest" | |
| TARGET_FULL_FILE_PATH: "/tmp/workdir/kernel/output_oras/linux-complete.git.tar" | |
| run: | | |
| bash oras_upload.sh | |