diff --git a/.github/workflows/kiwix-build_ci.yml b/.github/workflows/kiwix-build_ci.yml index b97be0db..71a5b1ea 100644 --- a/.github/workflows/kiwix-build_ci.yml +++ b/.github/workflows/kiwix-build_ci.yml @@ -4,6 +4,7 @@ on: push: paths: - 'kiwix-build_ci/**' + workflow_dispatch env: IMAGE_PREFIX: ghcr.io/kiwix/kiwix-build_ci_ @@ -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