diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 2813d35..ec03ad1 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -2,6 +2,11 @@ name: Build Image and Publish on: schedule: - cron: "0 5 * * *" + push: + branches: + - dev + release: + types: [published] env: @@ -27,8 +32,15 @@ jobs: echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Checkout Repo + if: github.event_name != 'schedule' uses: actions/checkout@v4 + - name: Checkout dev branch if scheduled + if: github.event_name == 'schedule' + uses: actions/checkout@v4 + with: + ref: dev + - name: Docker meta id: meta uses: docker/metadata-action@v5 @@ -38,9 +50,11 @@ jobs: ${{ env.dockerhub }} ${{ env.ghcr }} flavor: | - latest=false + latest=${{ startsWith(github.ref, 'refs/tags/') }} tags: | - development-v6 + type=schedule,pattern=nightly + type=ref,event=branch,enable=${{ github.event_name != 'schedule' }} + type=ref,event=tag - name: Login to DockerHub and GitHub Container Registry uses: ./.github/actions/login-repo @@ -115,9 +129,11 @@ jobs: ${{ env.dockerhub }} ${{ env.ghcr }} flavor: | - latest=false + latest=${{ startsWith(github.ref, 'refs/tags/') }} tags: | - development-v6 + type=schedule,pattern=nightly + type=ref,event=branch,enable=${{ github.event_name != 'schedule' }} + type=ref,event=tag - name: Login to DockerHub and GitHub Container Registry uses: ./.github/actions/login-repo