ClamAV CI #117
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: ClamAV CI | |
on: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 12 * * 1' | |
push: | |
branches: [ master, beta ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build-clam-av: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Build Repo | |
uses: actions/checkout@v2 | |
with: | |
path: ./build | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Docker Repo | |
id: repo | |
run: echo "::set-output name=repo::dcflachs/clamav" | |
- name: Set Main Tag | |
id: main_tag | |
shell: bash | |
run: | | |
if [[ "${{ steps.extract_branch.outputs.branch }}" == "master" ]] | |
then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=beta" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./build/clamav | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: | | |
${{ steps.repo.outputs.repo }}:${{ steps.main_tag.outputs.tag }} | |
${{ steps.repo.outputs.repo }}:nightly-${{ steps.date.outputs.date }} | |
build-fresh-clam: | |
runs-on: ubuntu-latest | |
needs: build-clam-av | |
steps: | |
- name: Checkout Build Repo | |
uses: actions/checkout@v2 | |
with: | |
path: ./build | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Docker Repo | |
id: repo | |
run: echo "::set-output name=repo::dcflachs/freshclam" | |
- name: Set Main Tag | |
id: main_tag | |
shell: bash | |
run: | | |
if [[ "${{ steps.extract_branch.outputs.branch }}" == "master" ]] | |
then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=beta" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./build/freshclam | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: | | |
${{ steps.repo.outputs.repo }}:${{ steps.main_tag.outputs.tag }} | |
${{ steps.repo.outputs.repo }}:nightly-${{ steps.date.outputs.date }} | |
build-clam-scan: | |
runs-on: ubuntu-latest | |
needs: build-clam-av | |
steps: | |
- name: Checkout Build Repo | |
uses: actions/checkout@v2 | |
with: | |
path: ./build | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Docker Repo | |
id: repo | |
run: echo "repo=dcflachs/clamscan" >> $GITHUB_OUTPUT | |
- name: Set Main Tag | |
id: main_tag | |
shell: bash | |
run: | | |
if [[ "${{ steps.extract_branch.outputs.branch }}" == "master" ]] | |
then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=beta" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./build/clamscan | |
platforms: linux/amd64 | |
push: true | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: | | |
${{ steps.repo.outputs.repo }}:${{ steps.main_tag.outputs.tag }} | |
${{ steps.repo.outputs.repo }}:nightly-${{ steps.date.outputs.date }} |