Skip to content

add version support #361

add version support

add version support #361

name: Build and test oc.user images linux/amd64, linux/arm64
on:
push:
env:
imagetag: ${{ github.head_ref || github.ref_name || 'dev' }}
jobs:
build_matrix:
strategy:
matrix:
target_mode: [default, hardening]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: "image tag"
run: echo "image tag set to ${{ matrix.target_mode }}"
- name: Run Buildx oc.user
run: |
./mkversion.sh ${{ matrix.target_mode }}
- name: Build test image abcdesktopio/oc.user:test
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.ubuntu
platforms: linux/amd64, linux/arm64
push: true
build-args: |
TARGET_MODE=${{ matrix.target_mode }}
ABCDESKTOP_LOCALACCOUNT_DIR=/etc/localaccount
TAG=22.04
BASE_IMAGE_RELEASE=22.04
BASE_IMAGE=ubuntu
tags: abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ imagetag }}

Check failure on line 54 in .github/workflows/test_update_linux_amd64.yml

View workflow run for this annotation

GitHub Actions / Build and test oc.user images linux/amd64, linux/arm64

Invalid workflow file

The workflow is not valid. .github/workflows/test_update_linux_amd64.yml (Line: 54, Col: 17): Unrecognized named-value: 'imagetag'. Located at position 1 within expression: imagetag .github/workflows/test_update_linux_amd64.yml (Line: 56, Col: 15): Unrecognized named-value: 'imagetag'. Located at position 1 within expression: imagetag
- name: Run and test docker image abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ imagetag }}
run: |
TARGET_MODE=${{ matrix.target_mode }} ./make-test.sh abcdesktopio/oc.user.${{ matrix.target_mode }}:test.${{ imagetag }}
- name: Build and push image oc.user.${{ matrix.target_mode }}:${{ imagetag }}
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.ubuntu
platforms: linux/amd64, linux/arm64
push: true
build-args: |
TARGET_MODE=${{ matrix.target_mode }}
ABCDESKTOP_LOCALACCOUNT_DIR=/etc/localaccount
TAG=22.04
BASE_IMAGE_RELEASE=22.04
BASE_IMAGE=ubuntu
tags: abcdesktopio/oc.user.${{ matrix.target_mode }}:${{ imagetag }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: abcdesktopio/oc.user.${{ matrix.target_mode }}:${{ imagetag }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'