History

Update docker-build.yml

Chaitanya Rahalkar committed 1 year ago

Commit 58085be1 parent 63effa31 file · +3 −8Browse files

Unified · Split

.github/workflows/docker-build.yml+3−8
@@ -2,11 +2,10 @@ name: Build and Push Docker Images · 1 unmodified line
2on:2on:
3 schedule:3 schedule:
4 - cron: '0 0 1 * *' # Run monthly on the 1st4 - cron: '0 0 1 * *' # Run monthly on the 1st
5 workflow_dispatch:5 workflow_dispatch: # Allow manual triggers
6env:6env:
7 REGISTRY: ghcr.io7 REGISTRY: ghcr.io
8 IMAGE_NAME: ${{ github.repository }}8 IMAGE_NAME: ${{ github.repository }}
9 TAG_DATE: ${{ format('{0}{1}{2}', github.event.repository.pushed_at.substring(0,4), github.event.repository.pushed_at.substring(5,7), github.event.repository.pushed_at.substring(8,10)) }}
10jobs:9jobs:
11 build-and-push:10 build-and-push:
12 runs-on: ubuntu-latest11 runs-on: ubuntu-latest
@@ -16,10 +15,6 @@ jobs: · 3 unmodified lines
16 steps:15 steps:
17 - name: Checkout repository16 - name: Checkout repository
18 uses: actions/checkout@v417 uses: actions/checkout@v4
19
20 - name: Set current date
21 id: date
22 run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
23 18
24 - name: Log in to the Container registry19 - name: Log in to the Container registry
25 uses: docker/login-action@v320 uses: docker/login-action@v3
@@ -35,7 +30,7 @@ jobs: · 9 unmodified lines
35 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}30 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36 tags: |31 tags: |
37 type=raw,value=latest32 type=raw,value=latest
38 type=raw,value=${{ env.DATE }}33 type=raw,value={{date 'YYYYMMDD'}}
39 34
40 - name: Build and push regular image35 - name: Build and push regular image
41 uses: docker/build-push-action@v536 uses: docker/build-push-action@v5
@@ -54,5 +49,5 @@ jobs: · 12 unmodified lines
54 push: true49 push: true
55 tags: |50 tags: |
56 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine51 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine
57 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine-${{ env.DATE }}52 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:alpine-{{date 'YYYYMMDD'}}
58 labels: ${{ steps.meta.outputs.labels }}53 labels: ${{ steps.meta.outputs.labels }}