Skip to content

build_latest_release_multi_images #5

build_latest_release_multi_images

build_latest_release_multi_images #5

name: build_latest_release_multi_images
on:
workflow_dispatch:
jobs:
build_multi_latest_release_tag:
name: ${{ matrix.build.name }}
runs-on: 'ubuntu-latest'
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
install_latest: [ true ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: "login docker hub"
run: |
podman login -u ${{secrets.DOCKER_HUB_USER}} -p ${{secrets.DOCKER_HUB_TOKEN}} docker.io
docker login -u ${{secrets.DOCKER_HUB_USER}} -p ${{secrets.DOCKER_HUB_TOKEN}}
- name: 'install dev deps'
run: |
sudo apt-get update
sudo apt-get -y install buildah less git make podman qemu qemu-user-static clamav clamav-freshclam
- name: Sets env vars
run: |
release_tag_redirect=$(curl -s https://github.com/curl/curl/releases/latest -w'%{redirect_url}\n' -o /dev/null)
latest_release_ref=$(basename ${release_tag_redirect})
echo "TAG_REF=$latest_release_ref" >> $GITHUB_ENV
rel=${latest_release_ref:5}
release_image_tag="${rel//_/.}"
echo "REL=$release_image_tag" >> $GITHUB_ENV
- name: 'build multi image'
run: buildah unshare make branch_or_ref=$TAG_REF release_tag=$REL multibuild
- name: 'test image'
run: buildah unshare make dist_name=localhost/curl-multi release_tag=$REL test
- name: 'security scan image'
run: make image_name=localhost/curl-multi:${REL} scan
- name: 'push release to docker hub'
run: |
buildah manifest push --format v2s2 --all localhost/curl-multi:$REL "docker://docker.io/flomesh/curl:${REL}"
buildah manifest push --format v2s2 --all localhost/curl-multi:$REL "docker://docker.io/flomesh/curl:latest"
buildah manifest push --format v2s2 --all localhost/curl-base-multi:$REL "docker://docker.io/flomesh/curl-base:${REL}"
buildah manifest push --format v2s2 --all localhost/curl-base-multi:$REL "docker://docker.io/flomesh/curl-base:latest"