Skip to content

Commit

Permalink
Run docker login in each docker build job
Browse files Browse the repository at this point in the history
docker login has a logout step at the end of the job.
This explains the insufficient privileges error displayed in the recent
builds
  • Loading branch information
tjamet committed Sep 22, 2023
1 parent 4269379 commit 75bd776
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "build-images"
name: "build-all-images"
on: # rebuild any PRs and main branch changes
pull_request:
push:
Expand All @@ -14,23 +14,7 @@ jobs:
steps:
- run: echo success

login:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: whalebrewci
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
docker-build:
needs:
- login
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -118,6 +102,17 @@ jobs:
- youtube-dl
- yq
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: whalebrewci
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-go/modified@master
id: is-modified
with:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/pushimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: string

jobs:
login:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
Expand All @@ -27,11 +27,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
docker-build:
needs:
- login
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
echo ::group::build image ${{ inputs.image }}:latest
Expand Down

0 comments on commit 75bd776

Please sign in to comment.