Skip to content

Commit

Permalink
reworked tags: always dev, latest and date on main ; added manual
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Oct 30, 2023
1 parent 6a8f7f5 commit 733a25b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/kiwix-build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- 'kiwix-build_ci/**'
workflow_dispatch

env:
IMAGE_PREFIX: ghcr.io/kiwix/kiwix-build_ci_
Expand All @@ -30,15 +31,17 @@ jobs:
- name: Build container image
run: |
docker build -t ${{ env.IMAGE_NAME }} - < kiwix-build_ci/${{ matrix.variant }}_builder.dockerfile
docker build -t ${{ env.IMAGE_NAME }}:dev - < kiwix-build_ci/${{ matrix.variant }}_builder.dockerfile
- name: Tag release container image
if: github.event.ref == 'refs/heads/main'
- name: Upload container image to :dev
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker tag ${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:latest
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
docker push ${{ env.IMAGE_NAME }}:dev
- name: Upload container image
- name: Update production tags
if: github.event.ref == 'refs/heads/main'
run: |
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
docker push --all-tags ${{ env.IMAGE_NAME }}
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker push ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest

0 comments on commit 733a25b

Please sign in to comment.