Skip to content

Commit

Permalink
Update GitHub workflows to use Docker contrib user
Browse files Browse the repository at this point in the history
Updates the GitHub workflows to use the appropriate user for pushing to
crossplanecontrib.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
  • Loading branch information
hasheddan committed Oct 5, 2022
1 parent 475f2cc commit f56888d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
DOCKER_USR: ${{ secrets.DOCKER_USR }}
CONTRIB_DOCKER_USR: ${{ secrets.CONTRIB_DOCKER_USR }}
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
AWS_USR: ${{ secrets.AWS_USR }}

Expand Down Expand Up @@ -297,9 +297,9 @@ jobs:

- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
if: env.CONTRIB_DOCKER_USR != ''
with:
username: ${{ secrets.DOCKER_USR }}
username: ${{ secrets.CONTRIB_DOCKER_USR }}
password: ${{ secrets.DOCKER_PSW }}

- name: Login to Upbound
Expand All @@ -312,18 +312,18 @@ jobs:

- name: Publish Artifacts to S3 and Docker Hub
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}
if: env.AWS_USR != '' && env.DOCKER_USR != ''
if: env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != ''
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }}
GIT_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Promote Artifacts in S3 and Docker Hub
if: github.ref == 'refs/heads/master' && env.AWS_USR != '' && env.DOCKER_USR != ''
if: github.ref == 'refs/heads/master' && env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != ''
run: make -j2 promote
env:
BRANCH_NAME: master
CHANNEL: master
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }}


10 changes: 5 additions & 5 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
# Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run
# a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether
# credentials have been provided before trying to run steps that need them.
DOCKER_USR: ${{ secrets.DOCKER_USR }}
CONTRIB_DOCKER_USR: ${{ secrets.CONTRIB_DOCKER_USR }}
AWS_USR: ${{ secrets.AWS_USR }}

jobs:
Expand All @@ -33,17 +33,17 @@ jobs:

- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
if: env.CONTRIB_DOCKER_USR != ''
with:
username: ${{ secrets.DOCKER_USR }}
username: ${{ secrets.CONTRIB_DOCKER_USR }}
password: ${{ secrets.DOCKER_PSW }}

- name: Promote Artifacts in S3 and Docker Hub
if: env.AWS_USR != '' && env.DOCKER_USR != ''
if: env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != ''
run: make -j2 promote BRANCH_NAME=${GITHUB_REF##*/}
env:
VERSION: ${{ github.event.inputs.version }}
CHANNEL: ${{ github.event.inputs.channel }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }}


0 comments on commit f56888d

Please sign in to comment.