container-publish.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. on:
  2. workflow_dispatch:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. env:
  8. REGISTRY: ghcr.io
  9. IMAGE_NAME: selkies-project/nvidia-glx-desktop
  10. jobs:
  11. build-bionic:
  12. runs-on: ubuntu-latest
  13. permissions:
  14. contents: read
  15. packages: write
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v3
  19. - name: Log into registry ${{ env.REGISTRY }}
  20. if: github.event_name != 'pull_request'
  21. uses: docker/login-action@v2
  22. with:
  23. registry: ${{ env.REGISTRY }}
  24. username: ${{ github.actor }}
  25. password: ${{ secrets.GITHUB_TOKEN }}
  26. - name: Extract Container metadata
  27. id: meta
  28. uses: docker/metadata-action@v4
  29. with:
  30. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  31. - name: Build and push Ubuntu 18.04 Container image
  32. uses: docker/build-push-action@v3
  33. with:
  34. build-args: |
  35. UBUNTU_RELEASE=18.04
  36. context: .
  37. push: ${{ github.event_name != 'pull_request' }}
  38. tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:18.04
  39. labels: ${{ steps.meta.outputs.labels }}
  40. build-focal:
  41. runs-on: ubuntu-latest
  42. permissions:
  43. contents: read
  44. packages: write
  45. steps:
  46. - name: Checkout repository
  47. uses: actions/checkout@v3
  48. - name: Log into registry ${{ env.REGISTRY }}
  49. if: github.event_name != 'pull_request'
  50. uses: docker/login-action@v2
  51. with:
  52. registry: ${{ env.REGISTRY }}
  53. username: ${{ github.actor }}
  54. password: ${{ secrets.GITHUB_TOKEN }}
  55. - name: Extract Container metadata
  56. id: meta
  57. uses: docker/metadata-action@v4
  58. with:
  59. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  60. - name: Build and push Ubuntu 20.04 Container image
  61. uses: docker/build-push-action@v3
  62. with:
  63. build-args: |
  64. UBUNTU_RELEASE=20.04
  65. context: .
  66. push: ${{ github.event_name != 'pull_request' }}
  67. tags: |
  68. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:20.04
  69. labels: ${{ steps.meta.outputs.labels }}
  70. build-jammy:
  71. runs-on: ubuntu-latest
  72. permissions:
  73. contents: read
  74. packages: write
  75. steps:
  76. - name: Checkout repository
  77. uses: actions/checkout@v3
  78. - name: Log into registry ${{ env.REGISTRY }}
  79. if: github.event_name != 'pull_request'
  80. uses: docker/login-action@v2
  81. with:
  82. registry: ${{ env.REGISTRY }}
  83. username: ${{ github.actor }}
  84. password: ${{ secrets.GITHUB_TOKEN }}
  85. - name: Extract Container metadata
  86. id: meta
  87. uses: docker/metadata-action@v4
  88. with:
  89. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  90. - name: Build and push Ubuntu 22.04 Container image
  91. uses: docker/build-push-action@v3
  92. with:
  93. build-args: |
  94. UBUNTU_RELEASE=22.04
  95. context: .
  96. push: ${{ github.event_name != 'pull_request' }}
  97. tags: |
  98. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
  99. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:22.04
  100. labels: ${{ steps.meta.outputs.labels }}