Skip to content

Commit

Permalink
Migrate from Docker Hub to ghcr.io for CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
caipira113 committed Aug 19, 2024
1 parent 79c1cbd commit c29f907
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,26 @@ jobs:
platform:
- linux/amd64
- linux/arm64
if: github.repository == 'misskey-dev/misskey'
outputs:
commit_sha: ${{ steps.git.outputs.commit_sha }}
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Check out the repo
uses: actions/[email protected]
- name: Get commit sha
id: git
run: echo "commit_sha=$(git rev-parse --short=7 HEAD)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
- name: Log in to Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
Expand Down Expand Up @@ -73,16 +78,18 @@ jobs:
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
- name: Log in to Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:develop \
docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:develop --tag ${{ env.REGISTRY_IMAGE }}::${{needs.build.outputs.commit_sha}} \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:develop
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{needs.build.outputs.commit_sha}}

1 comment on commit c29f907

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chromatic detects changes. Please review the changes on Chromatic.

Please sign in to comment.