|
30 | 30 | - name: Available platforms
|
31 | 31 | run: echo ${{ steps.buildx.outputs.platforms }} && docker version
|
32 | 32 |
|
| 33 | + - name: Login to Docker Hub |
| 34 | + uses: docker/login-action@v3 |
| 35 | + with: |
| 36 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 37 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 38 | + |
| 39 | + - name: Login to GitHub Container Registry |
| 40 | + uses: docker/login-action@v3 |
| 41 | + with: |
| 42 | + registry: ghcr.io |
| 43 | + username: ${{ github.actor }} |
| 44 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + |
33 | 46 | - name: Build and push image
|
34 | 47 | run: |
|
35 | 48 | echo "GithubRef: ${GITHUB_REF}"
|
|
41 | 54 | PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64,linux/arm/v7"
|
42 | 55 |
|
43 | 56 | echo "Building and pushing version ${IMAGE_VERSION} of image ${IMAGE_NAME}"
|
44 |
| - echo '${{ secrets.DOCKER_PASSWORD }}' | docker login -u '${{ secrets.DOCKER_USERNAME }}' --password-stdin |
45 | 57 | docker buildx build \
|
46 | 58 | --label "org.opencontainers.image.authors=https://github.com/mikefarah/yq/graphs/contributors" \
|
47 | 59 | --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \
|
|
59 | 71 | -t "${IMAGE_NAME}:${IMAGE_VERSION}" \
|
60 | 72 | -t "${IMAGE_NAME}:4" \
|
61 | 73 | -t "${IMAGE_NAME}:latest" \
|
| 74 | + -t "ghcr.io/${IMAGE_NAME}:${IMAGE_VERSION}" \ |
| 75 | + -t "ghcr.io/${IMAGE_NAME}:4" \ |
| 76 | + -t "ghcr.io/${IMAGE_NAME}:latest" \ |
62 | 77 | .
|
63 | 78 |
|
64 | 79 | cd github-action
|
|
79 | 94 | -t "${IMAGE_NAME}:${IMAGE_VERSION}-githubaction" \
|
80 | 95 | -t "${IMAGE_NAME}:4-githubaction" \
|
81 | 96 | -t "${IMAGE_NAME}:latest-githubaction" \
|
| 97 | + -t "ghcr.io/${IMAGE_NAME}:${IMAGE_VERSION}-githubaction" \ |
| 98 | + -t "ghrc.io/${IMAGE_NAME}:4-githubaction" \ |
| 99 | + -t "ghcr.io/${IMAGE_NAME}:latest-githubaction" \ |
82 | 100 | .
|
0 commit comments