Skip to content

Commit

Permalink
uses read and publish docker env variables according to scope (#49)
Browse files Browse the repository at this point in the history
* uses read and publish env variables accordingly

* Update .github/workflows/merge-publish.yml

Co-authored-by: Aaron Steinfeld <[email protected]>

* Update .github/workflows/publish.yml

Co-authored-by: Aaron Steinfeld <[email protected]>

Co-authored-by: Aaron Steinfeld <[email protected]>
  • Loading branch information
JBAhire and aaron-steinfeld authored Dec 22, 2020
1 parent 8137e08 commit 95bc542
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/merge-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}

- name: push docker image
run: ./gradlew dockerPushImages
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}

- name: Build with Gradle
run: ./gradlew build dockerBuildImages
Expand All @@ -46,8 +46,8 @@ jobs:
container:
image: hypertrace/helm-gcs-packager:0.3.0
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
steps:
- name: Check out code
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,25 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}

- name: Publish docker image
- name: publish docker image
run: ./gradlew publish dockerPushImages
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}
ORG_GRADLE_PROJECT_publishUser: ${{ secrets.BINTRAY_USER }}
ORG_GRADLE_PROJECT_publishApiKey: ${{ secrets.BINTRAY_API_KEY }}

publish-helm-charts:
needs: publish-images
runs-on: ubuntu-20.04
container:
image: hypertrace/helm-gcs-packager:0.3.0
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_READ_USER }}
password: ${{ secrets.DOCKERHUB_READ_TOKEN }}
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Checkout Repository
Expand Down

0 comments on commit 95bc542

Please sign in to comment.