build-stable-container.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. name: Build and release container
  2. on:
  3. workflow_dispatch:
  4. push:
  5. tags:
  6. - "v*"
  7. jobs:
  8. release:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v4
  13. - name: Install Crystal
  14. uses: crystal-lang/install-crystal@v1.8.2
  15. with:
  16. crystal: 1.12.2
  17. - name: Run lint
  18. run: |
  19. if ! crystal tool format --check; then
  20. crystal tool format
  21. git diff
  22. exit 1
  23. fi
  24. - name: Set up QEMU
  25. uses: docker/setup-qemu-action@v3
  26. with:
  27. platforms: arm64
  28. - name: Set up Docker Buildx
  29. uses: docker/setup-buildx-action@v3
  30. - name: Login to registry
  31. uses: docker/login-action@v3
  32. with:
  33. registry: quay.io
  34. username: ${{ secrets.QUAY_USERNAME }}
  35. password: ${{ secrets.QUAY_PASSWORD }}
  36. - name: Docker meta
  37. id: meta
  38. uses: docker/metadata-action@v5
  39. with:
  40. images: quay.io/invidious/invidious
  41. flavor: |
  42. latest=false
  43. tags: |
  44. type=semver,pattern={{version}}
  45. type=raw,value=latest
  46. labels: |
  47. quay.expires-after=12w
  48. - name: Build and push Docker AMD64 image for Push Event
  49. uses: docker/build-push-action@v5
  50. with:
  51. context: .
  52. file: docker/Dockerfile
  53. platforms: linux/amd64
  54. labels: ${{ steps.meta.outputs.labels }}
  55. push: true
  56. tags: ${{ steps.meta.outputs.tags }}
  57. build-args: |
  58. "release=1"
  59. - name: Docker meta
  60. id: meta-arm64
  61. uses: docker/metadata-action@v5
  62. with:
  63. images: quay.io/invidious/invidious
  64. flavor: |
  65. latest=false
  66. suffix=-arm64
  67. tags: |
  68. type=semver,pattern={{version}}
  69. type=raw,value=latest
  70. labels: |
  71. quay.expires-after=12w
  72. - name: Build and push Docker ARM64 image for Push Event
  73. uses: docker/build-push-action@v5
  74. with:
  75. context: .
  76. file: docker/Dockerfile.arm64
  77. platforms: linux/arm64/v8
  78. labels: ${{ steps.meta-arm64.outputs.labels }}
  79. push: true
  80. tags: ${{ steps.meta-arm64.outputs.tags }}
  81. build-args: |
  82. "release=1"