|
@@ -12,70 +12,44 @@ env:
|
|
|
REGISTRY: ghcr.io
|
|
REGISTRY: ghcr.io
|
|
|
IMAGE_NAME: selkies-project/nvidia-glx-desktop
|
|
IMAGE_NAME: selkies-project/nvidia-glx-desktop
|
|
|
jobs:
|
|
jobs:
|
|
|
- build-2004:
|
|
|
|
|
|
|
+ build:
|
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
permissions:
|
|
permissions:
|
|
|
contents: read
|
|
contents: read
|
|
|
packages: write
|
|
packages: write
|
|
|
|
|
+ strategy:
|
|
|
|
|
+ matrix:
|
|
|
|
|
+ include:
|
|
|
|
|
+ - os_version: "20.04"
|
|
|
|
|
+ latest_version: false
|
|
|
|
|
+ - os_version: "22.04"
|
|
|
|
|
+ latest_version: true
|
|
|
steps:
|
|
steps:
|
|
|
- name: Checkout repository
|
|
- name: Checkout repository
|
|
|
uses: actions/checkout@v4
|
|
uses: actions/checkout@v4
|
|
|
- name: Fetch commit time
|
|
- 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 }}
|
|
- 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:
|
|
with:
|
|
|
registry: ${{ env.REGISTRY }}
|
|
registry: ${{ env.REGISTRY }}
|
|
|
username: ${{ github.actor }}
|
|
username: ${{ github.actor }}
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
- - name: Extract Container metadata
|
|
|
|
|
|
|
+ - name: Extract container metadata
|
|
|
id: meta
|
|
id: meta
|
|
|
- uses: docker/metadata-action@v4
|
|
|
|
|
|
|
+ uses: docker/metadata-action@v5
|
|
|
with:
|
|
with:
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
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:
|
|
with:
|
|
|
build-args: |
|
|
build-args: |
|
|
|
- UBUNTU_RELEASE=20.04
|
|
|
|
|
|
|
+ UBUNTU_RELEASE=${{ matrix.os_version }}
|
|
|
context: .
|
|
context: .
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
tags: |
|
|
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 }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|