瀏覽代碼

Edit Actions workflow

Seungmin Kim 2 年之前
父節點
當前提交
b9972085ea
共有 3 個文件被更改,包括 19 次插入48 次删除
  1. 19 45
      .github/workflows/container-publish.yml
  2. 0 1
      Dockerfile
  3. 0 2
      xgl.yml

+ 19 - 45
.github/workflows/container-publish.yml

@@ -12,70 +12,44 @@ env:
   REGISTRY: ghcr.io
   IMAGE_NAME: selkies-project/nvidia-glx-desktop
 jobs:
-  build-2004:
+  build:
     runs-on: ubuntu-latest
     permissions:
       contents: read
       packages: write
+    strategy:
+      matrix:
+        include:
+        - os_version: "20.04"
+          latest_version: false
+        - os_version: "22.04"
+          latest_version: true
     steps:
     - name: Checkout repository
       uses: actions/checkout@v4
     - name: Fetch commit time
-      run: echo "COMMIT_TIME_GIT=$(TZ=UTC git show -s --format='%cd' --date=format-local:'%Y%m%d%H%M%S')" >> $GITHUB_ENV
+      run: echo "COMMIT_TIME_GIT=$(TZ=UTC git show -s --format='%cd' --date=format-local:'%Y%m%d%H%M%S')" >> "$GITHUB_ENV"
     - name: Log into registry ${{ env.REGISTRY }}
-      if: github.event_name != 'pull_request'
-      uses: docker/login-action@v2
+      if: ${{ github.event_name != 'pull_request' }}
+      uses: docker/login-action@v3
       with:
         registry: ${{ env.REGISTRY }}
         username: ${{ github.actor }}
         password: ${{ secrets.GITHUB_TOKEN }}
-    - name: Extract Container metadata
+    - name: Extract container metadata
       id: meta
-      uses: docker/metadata-action@v4
+      uses: docker/metadata-action@v5
       with:
         images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-    - name: Build and push Ubuntu 20.04 Container image
-      uses: docker/build-push-action@v4
+    - name: Build and push Ubuntu ${{ matrix.os_version }} container image
+      uses: docker/build-push-action@v5
       with:
         build-args: |
-          UBUNTU_RELEASE=20.04
+          UBUNTU_RELEASE=${{ matrix.os_version }}
         context: .
         push: ${{ github.event_name != 'pull_request' }}
         tags: |
-          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:20.04
-          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:20.04-${{ env.COMMIT_TIME_GIT }}
-        labels: ${{ steps.meta.outputs.labels }}
-  build-2204:
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-      packages: write
-    steps:
-    - name: Checkout repository
-      uses: actions/checkout@v4
-    - name: Fetch commit time
-      run: echo "COMMIT_TIME_GIT=$(TZ=UTC git show -s --format='%cd' --date=format-local:'%Y%m%d%H%M%S')" >> $GITHUB_ENV
-    - name: Log into registry ${{ env.REGISTRY }}
-      if: github.event_name != 'pull_request'
-      uses: docker/login-action@v2
-      with:
-        registry: ${{ env.REGISTRY }}
-        username: ${{ github.actor }}
-        password: ${{ secrets.GITHUB_TOKEN }}
-    - name: Extract Container metadata
-      id: meta
-      uses: docker/metadata-action@v4
-      with:
-        images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
-    - name: Build and push Ubuntu 22.04 Container image
-      uses: docker/build-push-action@v4
-      with:
-        build-args: |
-          UBUNTU_RELEASE=22.04
-        context: .
-        push: ${{ github.event_name != 'pull_request' }}
-        tags: |
-          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
-          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:22.04
-          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:22.04-${{ env.COMMIT_TIME_GIT }}
+          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os_version }}
+          ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.os_version }}-${{ env.COMMIT_TIME_GIT }}
+          ${{ matrix.latest_version == 'true' && format('{0}/{1}:latest', env.REGISTRY, env.IMAGE_NAME) || '' }}
         labels: ${{ steps.meta.outputs.labels }}

+ 0 - 1
Dockerfile

@@ -40,7 +40,6 @@ ENV PASSWD mypasswd
 ENV NOVNC_ENABLE false
 ENV WEBRTC_ENCODER nvh264enc
 ENV WEBRTC_ENABLE_RESIZE false
-ENV ENABLE_AUDIO true
 ENV ENABLE_BASIC_AUTH true
 
 # Set versions for components that should be manually checked before upgrading, other component versions are automatically determined by fetching the version online

+ 0 - 2
xgl.yml

@@ -63,8 +63,6 @@ spec:
           value: "nvh264enc"
         - name: WEBRTC_ENABLE_RESIZE
           value: "false"
-        - name: ENABLE_AUDIO
-          value: "true"
         - name: ENABLE_BASIC_AUTH
           value: "true"
         # Defaults to `PASSWD` if unspecified, choose either `value:` or `secretKeyRef:` but not both at the same time