add version support #361
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Build and test oc.user images linux/amd64, linux/arm64Invalid workflow file
|
||
- 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' | ||