rebuild-image.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. name: Rebuild
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. ref:
  6. description: 'ref to rebuild, can be a tag, branch or commit sha.'
  7. required: true
  8. default: 'v0.6.1'
  9. permissions:
  10. contents: read
  11. jobs:
  12. checkout:
  13. name: Checkout repo
  14. runs-on: ubuntu-latest
  15. outputs:
  16. timestamp: ${{ steps.timestamp.outputs.timestamp }}
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
  20. with:
  21. fetch-depth: 0
  22. ref: ${{ github.event.inputs.ref }}
  23. - name: set timestamp output
  24. id: timestamp
  25. run: |
  26. echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
  27. # this rebuilds the image and creates a new tag with a timestamp suffix
  28. # e.g. v0.6.1-1669145271 and v0.6.1-ubi-1669145271
  29. publish-artifacts:
  30. uses: ./.github/workflows/publish.yml
  31. needs: checkout
  32. permissions:
  33. id-token: write
  34. contents: read
  35. strategy:
  36. matrix:
  37. include:
  38. - dockerfile: "Dockerfile"
  39. build-args: "CGO_ENABLED=0"
  40. build-arch: "amd64 arm64 ppc64le"
  41. build-platform: "linux/amd64,linux/arm64,linux/ppc64le"
  42. tag-suffix: "-${{ needs.checkout.outputs.timestamp }}" # distroless
  43. - dockerfile: "Dockerfile.ubi"
  44. build-args: "CGO_ENABLED=0"
  45. build-arch: "amd64 arm64 ppc64le"
  46. build-platform: "linux/amd64,linux/arm64,linux/ppc64le"
  47. tag-suffix: "-ubi-${{ needs.checkout.outputs.timestamp }}" # ubi
  48. - dockerfile: "Dockerfile.ubi"
  49. build-args: "CGO_ENABLED=0 GOEXPERIMENT=boringcrypto" # fips
  50. build-arch: "amd64 ppc64le"
  51. build-platform: "linux/amd64,linux/ppc64le"
  52. tag-suffix: "-ubi-boringssl-${{ needs.checkout.outputs.timestamp }}"
  53. with:
  54. dockerfile: ${{ matrix.dockerfile }}
  55. tag-suffix: ${{ matrix.tag-suffix }}
  56. image-name: ghcr.io/${{ github.repository }}
  57. build-platform: ${{ matrix.build-platform }}
  58. build-args: ${{ matrix.build-args }}
  59. build-arch: ${{ matrix.build-arch }}
  60. ref: ${{ github.event.inputs.ref }}
  61. image-tag: ${{ github.event.inputs.ref }}
  62. secrets:
  63. GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
  64. GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}