container-image.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: container image
  2. on:
  3. push:
  4. pull_request:
  5. schedule:
  6. - cron: '0 20 * * 5'
  7. jobs:
  8. docker-build:
  9. runs-on: ubuntu-20.04
  10. steps:
  11. - uses: docker/setup-qemu-action@v2.2.0
  12. - uses: docker/setup-buildx-action@v2.7.0
  13. # > By default, this action uses the Git context so you don't need to use
  14. # > the actions/checkout action to checkout the repository because this
  15. # > will be done directly by buildkit. [...]
  16. # > any file mutation in the steps that precede [...] will be ignored
  17. # https://github.com/marketplace/actions/build-and-push-docker-images
  18. - uses: docker/build-push-action@v4.1.1
  19. with:
  20. platforms: |
  21. linux/amd64
  22. linux/arm/v7
  23. # potential alternative: https://github.com/docker/metadata-action
  24. build-args: REVISION=${{ github.sha }}
  25. # > $ skopeo copy --all oci-archive:oci-container-image.tar \
  26. # > docker://quay.io/fphammerle/test:test
  27. # > [...]
  28. # > FATA[0056] Error creating an updated image manifest: Error preparing
  29. # . updated manifest, layer "sha256:[...]": unsupported MIME type for
  30. # . compression: application/vnd.in-toto+json
  31. provenance: false
  32. # https://docs.docker.com/engine/reference/commandline/buildx_build/#output
  33. # https://github.com/opencontainers/image-spec
  34. outputs: type=oci,dest=oci-container-image.tar
  35. - uses: actions/upload-artifact@v3.1.2
  36. with: {path: oci-container-image.tar}