Skip to content

Commit

Permalink
Update checkout to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa committed Nov 20, 2024
1 parent 5aed6b9 commit f1d7f30
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
---
name: Build and Publish ClamAV Image
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * 0'

env:
DOCKER_NAME: clamav-rest
IMAGE: clamav
GH_REPO: gsa-tts/clamav-rest

jobs:
build-clamav:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get Date
shell: bash
id: date
run: |
echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Checkout Repository
uses: actions/checkout@v3

- name: Build Docker Image
run: docker build . -t ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }}

- name: Tag Image
run: |
docker tag ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }} ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}:${{ steps.date.outputs.date }}
docker tag ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }} ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}:latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Image
run: docker push --all-tags ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}
---
name: Build and Publish ClamAV Image
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * 0'

env:
DOCKER_NAME: clamav-rest
IMAGE: clamav
GH_REPO: gsa-tts/clamav-rest

jobs:
build-clamav:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get Date
shell: bash
id: date
run: |
echo "date=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build Docker Image
run: docker build . -t ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }}

- name: Tag Image
run: |
docker tag ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }} ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}:${{ steps.date.outputs.date }}
docker tag ${{ env.DOCKER_NAME }}:${{ steps.date.outputs.date }} ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}:latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push Image
run: docker push --all-tags ghcr.io/${{ env.GH_REPO }}/${{ env.IMAGE }}

0 comments on commit f1d7f30

Please sign in to comment.