diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 822643a6..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Publish - -on: - workflow_run: - workflows: Tests - branches: - - main - - master - types: completed - workflow_dispatch: - push: - branches: - - 'branch-2.*' - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }} - steps: - - name: Checkout triggering commit - if: ${{ github.event_name == 'workflow_run' }} - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_sha }} - fetch-tags: true - fetch-depth: 0 - - name: Checkout main commit - if: ${{ github.event_name != 'workflow_run' }} - uses: actions/checkout@v4 - with: - fetch-tags: true - fetch-depth: 0 - - name: Set build vars - run: | - echo "BUILD_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV - echo "BUILD_HASH=$GITHUB_SHA" >> $GITHUB_ENV - - name: Get tags - id: get-tags - shell: bash - run: ./.github/get-tags.py >> $GITHUB_OUTPUT - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@main - with: - name: shish2k/shimmie2 - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - cache: ${{ github.event_name != 'schedule' }} - buildoptions: "--build-arg RUN_TESTS=false" - buildargs: BUILD_TIME,BUILD_HASH - tags: "${{ steps.get-tags.outputs.tags }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf331253..361b8616 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -138,3 +138,35 @@ jobs: run: composer install --no-progress - name: Run test suite run: composer test + + publish: + name: Publish + runs-on: ubuntu-latest + needs: + - format + - static + - upgrade + - test + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/branch-2') + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + - name: Set build vars + id: get-vars + run: | + echo "BUILD_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV + echo "BUILD_HASH=$GITHUB_SHA" >> $GITHUB_ENV + ./.github/get-tags.py | tee -a $GITHUB_OUTPUT + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@main + with: + name: shish2k/shimmie2 + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + cache: ${{ github.event_name != 'schedule' }} + buildoptions: "--build-arg RUN_TESTS=false" + buildargs: BUILD_TIME,BUILD_HASH + tags: "${{ steps.get-vars.outputs.tags }}"