This repository was archived by the owner on Apr 15, 2026. It is now read-only.
feat(vyos): implement dedicated /30 transit link between CCR2004 and VyOS #81
Workflow file for this run
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: Sync Images | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'images/**' | |
| - 'infrastructure/network/vyos/**' | |
| pull_request: | |
| paths: | |
| - 'images/**' | |
| - 'infrastructure/network/vyos/**' | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: 'Force re-upload all images' | |
| type: boolean | |
| default: false | |
| prune: | |
| description: 'Run prune after sync' | |
| type: boolean | |
| default: false | |
| skip_hooks: | |
| description: 'Skip pre-upload hooks (tests)' | |
| type: boolean | |
| default: false | |
| concurrency: | |
| group: images-sync-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: tools/labctl/go.mod | |
| cache-dependency-path: tools/labctl/go.sum | |
| - name: Build labctl | |
| run: | | |
| cd tools/labctl | |
| go build -o ../../labctl . | |
| # Validate manifest structure and hook scripts | |
| - name: Validate Manifest | |
| run: | | |
| ./labctl images validate | |
| # Also validate hook scripts are executable | |
| for script in images/hooks/*.sh; do | |
| if [[ -f "${script}" && ! -x "${script}" ]]; then | |
| echo "ERROR: Script not executable: ${script}" | |
| exit 1 | |
| fi | |
| done | |
| # Install dependencies for pre-upload hooks (e.g., VyOS tests) | |
| # Skip on workflow_dispatch if skip_hooks is true | |
| - name: Install hook dependencies | |
| if: inputs.skip_hooks != true | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y p7zip-full squashfs-tools-ng | |
| - name: Install Containerlab | |
| if: inputs.skip_hooks != true | |
| run: | | |
| bash -c "$(curl -sL https://get.containerlab.dev)" | |
| containerlab version | |
| - name: Set up Python | |
| if: inputs.skip_hooks != true | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| cache-dependency-path: infrastructure/network/vyos/tests/requirements.txt | |
| - name: Install Python test dependencies | |
| if: inputs.skip_hooks != true | |
| run: | | |
| pip install -r infrastructure/network/vyos/tests/requirements.txt | |
| # Cache for downloaded ISOs and hook artifacts (rootfs.tar) | |
| - name: Setup labctl cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/labctl | |
| key: labctl-images-${{ hashFiles('images/images.yaml') }} | |
| restore-keys: | | |
| labctl-images- | |
| # Install tools needed for transform hooks (talhelper, sops) | |
| - name: Install SOPS | |
| run: | | |
| curl -LO https://github.com/getsops/sops/releases/download/v3.9.4/sops-v3.9.4.linux.amd64 | |
| chmod +x sops-v3.9.4.linux.amd64 | |
| sudo mv sops-v3.9.4.linux.amd64 /usr/local/bin/sops | |
| - name: Install talhelper | |
| run: | | |
| curl -LO https://github.com/budimanjojo/talhelper/releases/download/v3.0.43/talhelper_linux_amd64.tar.gz | |
| tar -xzf talhelper_linux_amd64.tar.gz | |
| chmod +x talhelper | |
| sudo mv talhelper /usr/local/bin/talhelper | |
| talhelper --version | |
| - name: Write SOPS age key | |
| run: | | |
| echo "${{ secrets.SOPS_AGE_KEY }}" > /tmp/age-key.txt | |
| chmod 600 /tmp/age-key.txt | |
| # PR: run sync without upload, skipping transform hooks (they require docker) | |
| - name: Sync Images (PR - no upload) | |
| if: github.event_name == 'pull_request' | |
| env: | |
| SOPS_AGE_KEY_FILE: /tmp/age-key.txt | |
| run: | | |
| ./labctl images sync --no-upload --skip-transform-hooks --cache-dir ~/.cache/labctl | |
| # Push/dispatch: full sync with credentials | |
| - name: Sync Images | |
| if: github.event_name != 'pull_request' | |
| id: sync | |
| env: | |
| SOPS_AGE_KEY_FILE: /tmp/age-key.txt | |
| run: | | |
| FLAGS="" | |
| if [ "${{ inputs.force }}" == "true" ]; then FLAGS="$FLAGS --force"; fi | |
| if [ "${{ inputs.skip_hooks }}" == "true" ]; then FLAGS="$FLAGS --skip-hooks"; fi | |
| ./labctl images sync \ | |
| --credentials images/e2.sops.yaml \ | |
| --sops-age-key-file /tmp/age-key.txt \ | |
| --cache-dir ~/.cache/labctl \ | |
| $FLAGS | |
| - name: Create PR if files changed | |
| if: github.event_name == 'push' && steps.sync.outputs.files_changed == 'true' | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: 'chore: update source image references' | |
| title: 'chore: update source image references' | |
| body: | | |
| Automated update of source image references. | |
| Updated by `labctl images sync`. | |
| branch: automated/image-updates | |
| labels: automated | |
| delete-branch: true | |
| - name: Prune Orphaned Images | |
| if: github.event_name != 'pull_request' && inputs.prune == true | |
| run: | | |
| ./labctl images prune \ | |
| --credentials images/e2.sops.yaml \ | |
| --sops-age-key-file /tmp/age-key.txt |