action.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: 'Build and Publish Container'
  2. description: 'Build and publish container'
  3. inputs:
  4. actor:
  5. required: true
  6. type: string
  7. image_tag:
  8. required: true
  9. type: string
  10. release_version:
  11. required: true
  12. type: string
  13. GITHUB_TOKEN:
  14. required: true
  15. type: string
  16. runs:
  17. using: "composite"
  18. steps:
  19. - name: Log into registry ghcr.io
  20. uses: docker/login-action@v3
  21. with:
  22. registry: ghcr.io
  23. username: ${{ inputs.actor }}
  24. password: ${{ inputs.GITHUB_TOKEN }}
  25. - name: Set up Docker Buildx
  26. uses: docker/setup-buildx-action@v3
  27. with:
  28. buildkitd-flags: --debug
  29. - name: Install Go
  30. uses: actions/setup-go@v5
  31. with:
  32. go-version: 'stable'
  33. - name: Set up just
  34. uses: extractions/setup-just@v2
  35. ## Install manifest-tool, which is required to combine multi-arch images
  36. ## https://github.com/estesp/manifest-tool
  37. - name: Install manifest-tool
  38. shell: bash
  39. run: |
  40. mkdir -p manifest-tool
  41. pushd manifest-tool
  42. wget -q https://github.com/estesp/manifest-tool/releases/download/v2.0.8/binaries-manifest-tool-2.0.8.tar.gz
  43. tar -xzf binaries-manifest-tool-2.0.8.tar.gz
  44. cp manifest-tool-linux-amd64 manifest-tool
  45. echo "$(pwd)" >> $GITHUB_PATH
  46. - name: Build and push (multiarch) OpenCost
  47. shell: bash
  48. env:
  49. IMAGE_TAG: ${{ inputs.image_tag }}
  50. RELEASE_VERSION: ${{ inputs.release_version }}
  51. run: |
  52. just build '$IMAGE_TAG' '$RELEASE_VERSION'