From 7de6ac7b6818c8011a4cf3a97b3c2e1cc2ec11e3 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 20 Oct 2023 19:46:31 +0200 Subject: [PATCH] Build all workflows in my fork (#2012) * Build all workflows in my fork * Build contributed recipes only in jupyter, because I don't have aarch64 runners --- .github/workflows/contributed-recipes.yml | 2 +- .github/workflows/docker-merge-tags.yml | 5 +++-- .github/workflows/docker-tag-push.yml | 5 +++-- .github/workflows/docker-wiki-update.yml | 5 ++++- .github/workflows/registry-overviews.yml | 2 +- .github/workflows/sphinx.yml | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/contributed-recipes.yml b/.github/workflows/contributed-recipes.yml index 59938180..2f8eeb44 100644 --- a/.github/workflows/contributed-recipes.yml +++ b/.github/workflows/contributed-recipes.yml @@ -35,7 +35,7 @@ jobs: test-recipes: runs-on: ${{ matrix.runsOn }} needs: generate-matrix - if: github.repository == 'jupyter/docker-stacks' + if: github.repository_owner == 'jupyter' steps: - name: Checkout Repo ⚡️ diff --git a/.github/workflows/docker-merge-tags.yml b/.github/workflows/docker-merge-tags.yml index 1c45747d..96434848 100644 --- a/.github/workflows/docker-merge-tags.yml +++ b/.github/workflows/docker-merge-tags.yml @@ -2,6 +2,7 @@ name: Download images tags from GitHub artifacts and create multi-platform manif env: OWNER: ${{ github.repository_owner }} + PUSH_TO_REGISTRY: (github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru') && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') on: workflow_call: @@ -47,13 +48,13 @@ jobs: shell: bash - name: Login to Registry 🔐 - if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + if: env.PUSH_TO_REGISTRY uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Merge tags for the images 🔀 - if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + if: env.PUSH_TO_REGISTRY run: python3 -m tagging.merge_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ shell: bash diff --git a/.github/workflows/docker-tag-push.yml b/.github/workflows/docker-tag-push.yml index a41ac3a7..179dce1e 100644 --- a/.github/workflows/docker-tag-push.yml +++ b/.github/workflows/docker-tag-push.yml @@ -3,6 +3,7 @@ name: Download Docker image and its tags from GitHub artifacts, apply them and p env: REGISTRY: docker.io OWNER: ${{ github.repository_owner }} + PUSH_TO_REGISTRY: (github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru') && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') on: workflow_call: @@ -37,7 +38,7 @@ jobs: platform: ${{ inputs.platform }} - name: Login to Registry 🔐 - if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + if: env.PUSH_TO_REGISTRY uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: username: ${{ secrets.REGISTRY_USERNAME }} @@ -52,6 +53,6 @@ jobs: run: python3 -m tagging.apply_tags --short-image-name ${{ inputs.image }} --tags-dir /tmp/jupyter/tags/ --platform ${{ inputs.platform }} --registry ${{ env.REGISTRY }} --owner ${{ env.OWNER }} - name: Push Images to Registry 📤 - if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + if: env.PUSH_TO_REGISTRY run: docker push --all-tags ${{ env.OWNER }}/${{ inputs.image }} shell: bash diff --git a/.github/workflows/docker-wiki-update.yml b/.github/workflows/docker-wiki-update.yml index bf07a5b4..4098747b 100644 --- a/.github/workflows/docker-wiki-update.yml +++ b/.github/workflows/docker-wiki-update.yml @@ -2,6 +2,9 @@ name: Download build manifests from GitHub artifacts and push them to GitHub wik # We're doing everything in one workflow on purpose # This way we make sure we don't access wiki pages from several jobs simultaneously +env: + PUSH_TO_REGISTRY: (github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru') && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + on: workflow_call: @@ -37,7 +40,7 @@ jobs: shell: bash - name: Push Wiki to GitHub 📤 - if: github.repository == 'jupyter/docker-stacks' && (github.ref == 'refs/heads/main' || github.event_name == 'schedule') + if: env.PUSH_TO_REGISTRY uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 with: commit_message: "Automated wiki publish for ${{ github.sha }}" diff --git a/.github/workflows/registry-overviews.yml b/.github/workflows/registry-overviews.yml index b3d3a7f3..025d75ff 100644 --- a/.github/workflows/registry-overviews.yml +++ b/.github/workflows/registry-overviews.yml @@ -17,7 +17,7 @@ jobs: update-overview: runs-on: ubuntu-latest name: update-overview (${{matrix.image}}) - if: github.repository == 'jupyter/docker-stacks' + if: github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru' steps: - name: Checkout Repo ⚡️ diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 78f1b950..fde0d4ea 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -26,7 +26,7 @@ jobs: build-docs: permissions: contents: write - if: github.repository == 'jupyter/docker-stacks' || github.event_name != 'schedule' + if: github.repository_owner == 'jupyter' || github.repository_owner == 'mathbunnyru' || github.event_name != 'schedule' runs-on: ubuntu-latest steps: