106 lines
3.6 KiB
YAML
106 lines
3.6 KiB
YAML
name: Build and push Almalinux 9 container images
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
name: Build almalinux9 container images
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
|
matrix:
|
|
flavor: ["default", "micro"]
|
|
version: ["9.3", "9.4", "9.5"]
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Login to docker.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
# - name: Set up QEMU
|
|
# uses: docker/setup-qemu-action@v3
|
|
- name: Setup Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- if: ${{ matrix.flavor }} == 'default'
|
|
name: Build and push almalinux
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
# platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
context: .
|
|
file: ./9/Dockerfile.${{ matrix.flavor }}
|
|
build-args: |
|
|
ALMALINUX_VERSION=${{ matrix.version }}
|
|
tags: |
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:${{ matrix.version }}
|
|
- if: ${{ matrix.flavor }} == 'micro'
|
|
name: Build and push almalinux
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
# platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
context: .
|
|
file: ./9/Dockerfile.${{ matrix.flavor }}
|
|
build-args: |
|
|
ALMALINUX_VERSION=${{ matrix.version }}
|
|
tags: |
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:${{ matrix.version }}-${{ matrix.flavor }}
|
|
- if: ${{ matrix.flavor }} == 'default'
|
|
name: Scan almalinux9 image with Trivy
|
|
uses: aquasecurity/trivy-action@0.20.0
|
|
with:
|
|
image-ref: '${{ vars.DOCKERHUB_USERNAME }}/almalinux:${{ matrix.version }}'
|
|
format: 'sarif'
|
|
output: 'trivy-results.sarif'
|
|
- if: ${{ matrix.flavor }} == 'micro'
|
|
name: Scan almalinux9 image with Trivy
|
|
uses: aquasecurity/trivy-action@0.20.0
|
|
with:
|
|
image-ref: '${{ vars.DOCKERHUB_USERNAME }}/almalinux:${{ matrix.version }}-${{ matrix.flavor }}'
|
|
format: 'sarif'
|
|
output: 'trivy-results.sarif'
|
|
build-latest:
|
|
name: Build latest almalinux9 container images
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Login to docker.io
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
# - name: Set up QEMU
|
|
# uses: docker/setup-qemu-action@v3
|
|
- name: Setup Docker buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Build and push latest almalinux9-micro
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
# platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
context: .
|
|
file: ./9/Dockerfile.micro
|
|
tags: |
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:9-micro
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:micro
|
|
- name: Build and push latest almalinux9
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
# platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
context: .
|
|
file: ./9/Dockerfile.default
|
|
tags: |
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:9
|
|
${{ vars.DOCKERHUB_USERNAME }}/almalinux:latest
|