container-publish.yml 3.2 KB

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