diff --git a/.circleci/config.yml b/.circleci/config.yml index 7b94cfa9..3365a9e2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,6 +92,19 @@ aliases: - &src "/tmp/src/petprep" orbs: docker: circleci/docker@2.1.4 +parameters: + GHA_Actor: + type: string + default: "" + GHA_Action: + type: string + default: "" + GHA_Event: + type: string + default: "" + GHA_Meta: + type: string + default: "" jobs: build_clean: @@ -428,6 +441,25 @@ jobs: steps: - run: echo Deploying! + pull_image: + <<: *machine_defaults + environment: + GHA_Actor: << pipeline.parameters.GHA_Actor >> + GHA_Event: << pipeline.parameters.GHA_Event >> + GHA_Action: << pipeline.parameters.GHA_Action >> + GHA_Meta: << pipeline.parameters.GHA_Meta >> + REVISION: << pipeline.git.revision >> + steps: + - checkout + - run: + name: Print parameters + command: | + echo $GHA_Actor + echo $GHA_Event + echo $GHA_Action + echo $GHA_Meta + echo $REVISION + workflows: version: 2 build_from_scratch: @@ -444,6 +476,11 @@ workflows: context: - nipreps-common + github: + when: << pipeline.parameters.GHA_Action >> + jobs: + - pull_image + build_test_deploy: jobs: - build: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bd881aef..d52737fb 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,7 +34,6 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -51,7 +50,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64 @@ -62,3 +61,7 @@ jobs: cache-to: type=inline env: TARGET_BRANCH: ${{ github.base_ref || github.ref_name }} + + - uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.2.0 + with: + GHA_Meta: ${{ github.base_ref || github.ref_name }}