From 46dca17557dd0a97bdb3ae9c592aaea69b2f9afc Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Tue, 10 Dec 2024 00:19:53 +0100 Subject: [PATCH] try to freeze dokerfile to a dotclear branch --- .github/workflows/release_stable.yml | 68 +++++++++++++--------------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release_stable.yml b/.github/workflows/release_stable.yml index 5da060a..7f10f91 100644 --- a/.github/workflows/release_stable.yml +++ b/.github/workflows/release_stable.yml @@ -47,12 +47,6 @@ jobs: dockerhub_username: ${{ secrets.DOCKER_USERNAME }} dockerhub_token: ${{ secrets.DOCKER_TOKEN }} - - name: Check repository branch - id: branch - uses: GuillaumeFalourd/branch-exists@v1.1 - with: - branch: ${{ steps.dotclear.outputs.tag }} - - name: notfound if: (steps.registry.outputs.image_exists == 'false') run: | @@ -65,36 +59,11 @@ jobs: SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.tag }} found.' echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY - do_branch: - needs: check_image - if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true')) - name: Create repository branch - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Create repository branch - id: create - uses: peterjgrainger/action-create-branch@v3.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check repository branch + id: branch + uses: GuillaumeFalourd/branch-exists@v1.1 with: - branch: ${{ needs.check_image.outputs.version }} - - - name: notfound - if: (steps.create.outputs.created == 'false') - run: | - SUMMARY=$'Branch ${{ needs.check_image.outputs.version }} has not been created.' - echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY - - - name: found - if: (steps.create.outputs.created == 'true') - run: | - SUMMARY=$' Branch ${{ needs.check_image.outputs.version }} has been created.' - echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY + branch: ${{ steps.dotclear.outputs.tag }} do_image: needs: check_image @@ -103,13 +72,40 @@ jobs: runs-on: ubuntu-latest permissions: packages: write - contents: read + contents: write attestations: write id-token: write steps: - name: Check out the repo + if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true')) uses: actions/checkout@v4 + - name: Create repository branch + if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true')) + id: create + uses: peterjgrainger/action-create-branch@v3.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branch: ${{ needs.check_image.outputs.version }} + + - name: notcreated + if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true')) && (steps.create.outputs.created == 'false') + run: | + SUMMARY=$'Branch ${{ needs.check_image.outputs.version }} has not been created.' + echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY + + - name: created + if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true')) && (steps.create.outputs.created == 'true') + run: | + SUMMARY=$' Branch ${{ needs.check_image.outputs.version }} has been created.' + echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY + + - name: Check out the repo + uses: actions/checkout@v4 + with: + branch: ${{ needs.check_image.outputs.version }} + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3