container-publish.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-2004:
  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 20.04 Container image
  35. uses: docker/build-push-action@v3
  36. with:
  37. build-args: |
  38. UBUNTU_RELEASE=20.04
  39. context: .
  40. push: ${{ github.event_name != 'pull_request' }}
  41. tags: |
  42. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:20.04
  43. labels: ${{ steps.meta.outputs.labels }}
  44. build-2204:
  45. runs-on: ubuntu-latest
  46. permissions:
  47. contents: read
  48. packages: write
  49. steps:
  50. - name: Checkout repository
  51. uses: actions/checkout@v3
  52. - name: Log into registry ${{ env.REGISTRY }}
  53. if: github.event_name != 'pull_request'
  54. uses: docker/login-action@v2
  55. with:
  56. registry: ${{ env.REGISTRY }}
  57. username: ${{ github.actor }}
  58. password: ${{ secrets.GITHUB_TOKEN }}
  59. - name: Extract Container metadata
  60. id: meta
  61. uses: docker/metadata-action@v4
  62. with:
  63. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  64. - name: Build and push Ubuntu 22.04 Container image
  65. uses: docker/build-push-action@v3
  66. with:
  67. build-args: |
  68. UBUNTU_RELEASE=22.04
  69. context: .
  70. push: ${{ github.event_name != 'pull_request' }}
  71. tags: |
  72. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
  73. ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:22.04
  74. labels: ${{ steps.meta.outputs.labels }}