Skip to content

Commit

Permalink
Fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
s1061123 committed Apr 6, 2023
1 parent 8f72cf7 commit 12ec153
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@ jobs:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to GitHub Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platform: linux/amd64
tags: |
ghcr.io/${{ github.repository }}:latest-amd64
ghcr.io/${{ github.repository }}:snapshot-amd64
Expand All @@ -39,9 +40,11 @@ jobs:
- name: Create manifest for multi-arch images
if: github.repository_owner == 'k8snetworkplumbingwg'
run: |
docker pull ${REPOSITORY}:snapshot-amd64
docker manifest create ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64
docker manifest annotate ${REPOSITORY}:snapshot ${REPOSITORY}:snapshot-amd64 --arch amd64
docker manifest push ${REPOSITORY}:snapshot
docker pull ${REPOSITORY}:latest-amd64
docker manifest create ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64
docker manifest annotate ${REPOSITORY}:latest ${REPOSITORY}:latest-amd64 --arch amd64
docker manifest push ${REPOSITORY}:latest
11 changes: 7 additions & 4 deletions .github/workflows/push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -34,9 +34,10 @@ jobs:

- name: Push to GitHub Container Registry
if: github.repository_owner == 'k8snetworkplumbingwg'
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
platform: linux/amd64
tags: |
ghcr.io/${{ github.repository }}:stable-amd64
${{ steps.docker_meta.outputs.tags }}-amd64
Expand All @@ -45,9 +46,11 @@ jobs:
- name: Create manifest for multi-arch images
if: github.repository_owner == 'k8snetworkplumbingwg'
run: |
docker pull ${REPOSITORY}:snapshot-amd64
docker manifest create ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64 --arch amd64
docker manifest push ${{ env.REPOSITORY }}:stable
docker pull ${REPOSITORY}:latest-amd64
docker manifest create ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64 --arch amd64
docker manifest push ${{ steps.docker_meta.outputs.tags }}

0 comments on commit 12ec153

Please sign in to comment.