diff options
author | Finlay Davidson <finlay.davidson@coderclass.nl> | 2022-06-16 09:32:16 +0200 |
---|---|---|
committer | JF <JF002@users.noreply.github.com> | 2022-07-08 17:13:47 +0200 |
commit | 6a0aec08501bcd1b3abe35ba9db9d6618e5b4b28 (patch) | |
tree | 68b91ed714f3b2b1f075678de9b977b12b75620b /.github/workflows | |
parent | 4ee3e51605272464587f16f23633fc062be19f66 (diff) |
Use either a secret or infinitime as username
Uses either the DOCKER_HUB_USERNAME secret or just infinitime as
the username for pushing to and pulling from Docker Hub.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/docker.yml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f7aeb7d5..d4669206 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,6 +13,8 @@ on: jobs: build: runs-on: ubuntu-latest + env: + USERNAME: infinitime steps: - uses: actions/checkout@v3 @@ -20,7 +22,7 @@ jobs: if: github.event_name == 'push' uses: docker/login-action@v2 with: - username: infinitime + username: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Set up QEMU @@ -37,6 +39,6 @@ jobs: platforms: linux/amd64,linux/arm64 builder: ${{ steps.buildx.outputs.name }} push: ${{ github.event_name == 'push' }} - tags: infinitime/infinitime-build:latest - cache-from: type=registry,ref=infinitime/infinitime-build:buildcache - cache-to: type=registry,ref=infinitime/infinitime-build:buildcache,mode=max + tags: ${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:latest + cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache + cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME || env.USERNAME }}/infinitime-build:buildcache,mode=max |