feat(k3d): alternative to docker compose installation with single nod… #381
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: CI | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| paths-ignore: | |
| - 'demo/**' | |
| - 'docs/**' | |
| - 'examples/**' | |
| - 'helm/ggbridge/README.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'SECURITY.md' | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| description: "Specify the runner to use" | |
| required: true | |
| default: "ubuntu-latest" | |
| permissions: | |
| actions: read | |
| attestations: write | |
| contents: read | |
| id-token: write | |
| security-events: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-packages: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| arch: amd64 | |
| - os: ubuntu-24.04-arm | |
| arch: arm64 | |
| name: Build packages for ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set GitHub vars | |
| id: github | |
| uses: ./.github/actions/github | |
| - name: Write Melange Signing Key | |
| id: melange-signing-key | |
| shell: bash | |
| env: | |
| PUBLIC_KEY_BASE64: ${{ vars.MELANGE_PUBLIC_KEY_BASE64 }} | |
| SIGNING_KEY_BASE64: ${{ secrets.MELANGE_SIGNING_KEY_BASE64 }} | |
| run: | | |
| mkdir -p ${{ github.workspace }}/packages | |
| echo -n "$PUBLIC_KEY_BASE64" | base64 -d > ${{ github.workspace }}/packages/melange.rsa.pub | |
| echo -n "$SIGNING_KEY_BASE64" | base64 -d > ${{ github.workspace }}/packages/melange.rsa | |
| file ${{ github.workspace }}/packages/melange.rsa | |
| - name: Build packages | |
| id: apk | |
| uses: ./.github/actions/melange | |
| with: | |
| arch: ${{ steps.github.outputs.arch }} | |
| signing-key: ${{ github.workspace }}/packages/melange.rsa | |
| output-dir: ${{ github.workspace }}/packages | |
| - name: Upload packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages-${{ steps.github.outputs.arch }} | |
| path: ${{ github.workspace }}/packages/${{ steps.github.outputs.arch }}/ | |
| retention-days: 1 | |
| publish: | |
| strategy: | |
| matrix: | |
| include: | |
| - variant: prod | |
| tag-suffix: '' | |
| - variant: shell | |
| tag-suffix: '-shell' | |
| name: Publish ${{ matrix.variant }} image | |
| needs: [build-packages] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: imjasonh/[email protected] | |
| - uses: sigstore/cosign-installer@v3 | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set GitHub vars | |
| id: github | |
| uses: ./.github/actions/github | |
| - name: Write Melange Public Key | |
| id: melange-public-key | |
| shell: bash | |
| env: | |
| PUBLIC_KEY_BASE64: ${{ vars.MELANGE_PUBLIC_KEY_BASE64 }} | |
| run: | | |
| mkdir -p ${{ github.workspace }}/packages | |
| echo -n "$PUBLIC_KEY_BASE64" | base64 -d > ${{ github.workspace }}/packages/melange.rsa.pub | |
| - name: Download aarch64 packages | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: packages-aarch64 | |
| path: ${{ github.workspace }}/packages/aarch64 | |
| - name: Download x86_64 packages | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: packages-x86_64 | |
| path: ${{ github.workspace }}/packages/x86_64 | |
| - name: Publish image | |
| id: publish | |
| uses: ./.github/actions/apko | |
| with: | |
| config: 'apko/${{ matrix.variant }}.yaml' | |
| tag: 'ttl.sh/${{ steps.github.outputs.repository }}:${{ steps.github.outputs.short-sha }}${{ matrix.tag-suffix }}' | |
| repository-append: ${{ github.workspace }}/packages | |
| keyring-append: ${{ github.workspace }}/packages/melange.rsa.pub | |
| publish: 'true' | |
| - name: Scan image | |
| id: scan | |
| uses: anchore/scan-action@v7 | |
| with: | |
| image: 'ttl.sh/${{ steps.github.outputs.repository }}:${{ steps.github.outputs.short-sha }}${{ matrix.tag-suffix }}' | |
| cache-db: true | |
| fail-build: 'false' | |
| severity-cutoff: 'high' | |
| output-format: 'sarif' | |
| - name: Sign and Attest | |
| id: sign | |
| uses: ./.github/actions/cosign | |
| with: | |
| image: 'ttl.sh/${{ steps.github.outputs.repository }}:${{ steps.github.outputs.short-sha }}${{ matrix.tag-suffix }}' | |
| publish-chart: | |
| name: Publish Helm Chart | |
| needs: [publish] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: azure/[email protected] | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set GitHub vars | |
| id: github | |
| uses: ./.github/actions/github | |
| - name: Set Helm image registry | |
| run: | | |
| yq eval '.global.imageRegistry = "ttl.sh"' -i ${{ github.workspace }}/helm/ggbridge/values.yaml | |
| - name: Publish Helm chart | |
| uses: ./.github/actions/helm | |
| with: | |
| chart: ${{ github.workspace }}/helm/ggbridge | |
| version: '0.1.0-${{ github.run_number }}' | |
| app-version: ${{ steps.github.outputs.short-sha }} | |
| publish: 'true' | |
| registry: oci://ttl.sh/${{ steps.github.outputs.repository }}/helm |