Skip to content

Commit

Permalink
Login to DockerHub to increase pull limit rate
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur authored Jul 3, 2024
1 parent 733146d commit e43c1cf
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/actions/build-project/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ inputs:
workflow-name:
description: "Name of the calling workflow, used to resolve build URL. Leave empty to use default (execute-build-plan / {{github.job}} (<project-name>))"
default: ""
dockerhub-username:
description: "Docker Hub username"
required: true
dockerhub-token:
description: "Docker Hub password"
required: true

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -106,6 +113,12 @@ runs:
run: |
echo "${{ inputs.github-key }}" > ${{ github.workspace }}/github_key
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}

- name: Build project
uses: addnab/docker-run-action@v3
if: steps.check-history.outputs.can-skip-build != 'true'
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/setup-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ inputs:
repository-branch:
description: "GitHub repository branch for compiler to build"
required: true
# Infrastracture secrets
dockerhub-username:
description: "Docker Hub username"
required: true
dockerhub-token:
description: "Docker Hub password"
required: true
outputs:
scala-version:
description: "Effective Scala version, input value of scala-version if using published version or version of builded compiler"
Expand Down Expand Up @@ -71,6 +78,12 @@ runs:
echo "Can skip compiler build: ${isPublished}"
echo "is-compiler-published=${isPublished}" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub-username }}
password: ${{ inputs.dockerhub-token }}

- name: Build compiler
uses: addnab/docker-run-action@v3
if: steps.check-published.outputs.is-compiler-published == 'false'
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/buildPlan-A.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ on:
required: true
OPENCB_ELASTIC_PSWD:
required: true
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:
setup-build:
Expand All @@ -61,6 +65,8 @@ jobs:
scala-version: ${{ inputs.published-scala-version }}
repository-url: ${{ inputs.repository-url }}
repository-branch: ${{ inputs.repository-branch }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

stage-0:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -107,6 +113,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-1:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -386,6 +394,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-2:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -665,6 +675,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-3:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -944,6 +956,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-4:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -1182,3 +1196,5 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/buildPlan-B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ on:
required: true
OPENCB_ELASTIC_PSWD:
required: true
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:
setup-build:
Expand All @@ -61,6 +65,8 @@ jobs:
scala-version: ${{ inputs.published-scala-version }}
repository-url: ${{ inputs.repository-url }}
repository-branch: ${{ inputs.repository-branch }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

stage-0:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -341,6 +347,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-1:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -620,6 +628,8 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
stage-2:
runs-on: ubuntu-22.04
needs: [ setup-build ]
Expand Down Expand Up @@ -725,3 +735,5 @@ jobs:
maven-repo-url: ${{ needs.setup-build.outputs.maven-repo-url }}
elastic-user: ${{ secrets.OPENCB_ELASTIC_USER }}
elastic-password: ${{ secrets.OPENCB_ELASTIC_PSWD }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

0 comments on commit e43c1cf

Please sign in to comment.