|
| 1 | +name: build bare metal maintenance image |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + secrets: |
| 6 | + GITHUB_TOKEN_IN: |
| 7 | + required: true |
| 8 | + CACHIX_AUTH_TOKEN: |
| 9 | + required: true |
| 10 | + outputs: |
| 11 | + image: |
| 12 | + description: "Pushed cleanup-bare-metal image reference" |
| 13 | + value: ${{ jobs.build-image.outputs.image }} |
| 14 | + |
| 15 | +env: |
| 16 | + container_registry: ghcr.io/edgelesssys |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-image: |
| 20 | + name: "Build cleanup-bare-metal image" |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + permissions: |
| 23 | + contents: read |
| 24 | + packages: write |
| 25 | + outputs: |
| 26 | + image: "${{ steps.build.outputs.image }}" |
| 27 | + env: |
| 28 | + SET: base |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 31 | + with: |
| 32 | + persist-credentials: false |
| 33 | + - uses: ./.github/actions/setup_nix |
| 34 | + with: |
| 35 | + githubToken: ${{ secrets.GITHUB_TOKEN_IN || secrets.GITHUB_TOKEN }} |
| 36 | + cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 37 | + - uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 |
| 38 | + - name: Log in to ghcr.io Container registry |
| 39 | + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 |
| 40 | + with: |
| 41 | + registry: ghcr.io |
| 42 | + username: ${{ github.actor }} |
| 43 | + password: ${{ secrets.GITHUB_TOKEN_IN || secrets.GITHUB_TOKEN }} |
| 44 | + - name: Create justfile.env |
| 45 | + run: | |
| 46 | + cat <<EOF > justfile.env |
| 47 | + container_registry=${{ env.container_registry }} |
| 48 | + set=${SET} |
| 49 | + EOF |
| 50 | + - name: Build and push cleanup-bare-metal image |
| 51 | + id: build |
| 52 | + env: |
| 53 | + ghcr: ${{ env.container_registry }} |
| 54 | + run: | |
| 55 | + just push cleanup-bare-metal |
| 56 | + image=$(sed -n "s#${{ env.container_registry }}/contrast/cleanup-bare-metal:latest=##p" ./workspace/just.containerlookup) |
| 57 | + echo "image=${image}" >> "$GITHUB_OUTPUT" |
0 commit comments