Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update push script to use ghcr.io #106

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@ jobs:
runs-on: ubuntu-latest
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 @@ -120,16 +137,14 @@ jobs:
fi
if: steps.is-modified.outputs.modified == 'true' || (github.event_name == 'push' && github.event.ref == 'refs/heads/re-builld-all')
- run: |
echo ${{ secrets.DOCKER_HUB_PASSWORD }} | base64 -d | docker login --password-stdin -u whalebrewci
echo ${{ github.token }} | docker login --password-stdin -u ${{ github.actor }} docker.pkg.github.com
docker tag ${{ matrix.image }} ${{ github.event.repository.owner.name}}/${{ matrix.image }}
docker tag ${{ matrix.image }} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}
docker tag ${{ matrix.image }} ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}
if [ -e "${{ matrix.image }}/tags.yaml" ]; then
for tag in $(cat "${{ matrix.image }}/tags.yaml" | docker run --rm -i whalebrew/yq -r '.versions[]'); do
docker tag ${{ matrix.image }}:${tag} ${{ github.event.repository.owner.name}}/${{ matrix.image }}:${tag}
docker tag ${{ matrix.image }}:${tag} docker.pkg.github.com/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag}
docker tag ${{ matrix.image }}:${tag} ghcr.io/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag}
docker push ${{ github.event.repository.owner.name}}/${{ matrix.image }}:${tag}
docker push docker.pkg.github.com/${{ github.event.repository.owner.name}}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag}
docker push ghcr.io/${{ github.event.repository.owner.name}}/${{ github.event.repository.name }}/${{ matrix.image }}:${tag}
done
fi

Expand Down