Skip to content

Commit

Permalink
Set up mutliarch promote image build (TEST)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunidhi-Gaonkar1 committed Jul 1, 2022
1 parent bdfa79f commit 80697b7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/devel_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Publish quay.io/ansible/receptor:devel

on:
push:
branches: [devel]
branches: [multiarch-gha-test]

jobs:
release:
Expand All @@ -31,22 +31,22 @@ jobs:
run: |
export CONTAINERCMD="docker buildx"
export EXTRA_OPTS="--platform linux/amd64 --load"
make container REPO=quay.io/ansible/receptor TAG=devel
make container REPO=quay.io/siddhesh_ghadi/ansible_receptor TAG=devel
- name: Test Image
run: docker run --rm quay.io/ansible/receptor:devel receptor --version
run: docker run --rm quay.io/siddhesh_ghadi/ansible_receptor:devel receptor --version

- name: Login To Quay
uses: docker/login-action@v2
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
registry: quay.io/ansible/receptor
registry: quay.io/siddhesh_ghadi/ansible_receptor

# Since x86 image is built in previous step
# buildx will use cached image, hence overall time will not be affected
- name: Build Multiarch Image & Push To Quay
run: |
export CONTAINERCMD="docker buildx"
export EXTRA_OPTS="--platform linux/amd64,linux/ppc64le --push"
make container REPO=quay.io/ansible/receptor TAG=devel
make container REPO=quay.io/siddhesh_ghadi/ansible_receptor TAG=devel
40 changes: 21 additions & 19 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,26 @@ jobs:
run: |
python3 -m pip install twine build
- name: Set official pypi info
run: echo pypi_repo=pypi >> $GITHUB_ENV
if: ${{ github.repository_owner == 'ansible' }}

- name: Set unofficial pypi info
run: echo pypi_repo=testpypi >> $GITHUB_ENV
if: ${{ github.repository_owner != 'ansible' }}

- name: Build receptorctl and upload to pypi
run: |
make receptorctl_wheel receptorctl_sdist VERSION=${{ github.event.release.tag_name }}
twine upload \
-r ${{ env.pypi_repo }} \
-u ${{ secrets.PYPI_USERNAME }} \
-p ${{ secrets.PYPI_PASSWORD }} \
receptorctl/dist/*
# - name: Set official pypi info
# run: echo pypi_repo=pypi >> $GITHUB_ENV
# if: ${{ github.repository_owner == 'ansible' }}

# - name: Set unofficial pypi info
# run: echo pypi_repo=testpypi >> $GITHUB_ENV
# if: ${{ github.repository_owner != 'ansible' }}

# - name: Build receptorctl and upload to pypi
# run: |
# make receptorctl_wheel receptorctl_sdist VERSION=${{ github.event.release.tag_name }}
# twine upload \
# -r ${{ env.pypi_repo }} \
# -u ${{ secrets.PYPI_USERNAME }} \
# -p ${{ secrets.PYPI_PASSWORD }} \
# receptorctl/dist/*

- name: Log in to GHCR
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand All @@ -46,9 +48,9 @@ jobs:
- name: Copy Image to Quay
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}
src: ghcr.io/sunidhi-gaonkar1/receptor:${{ github.event.release.tag_name }}
dst: |
quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
quay.io/${{ github.repository }}:latest
quay.io/siddhesh_ghadi/ansible_receptor:${{ github.event.release.tag_name }}
quay.io/siddhesh_ghadi/ansible_receptor:latest
9 changes: 3 additions & 6 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,14 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Log in to registry
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build container image
run: |
make container CONTAINERCMD="docker buildx" EXTRA_OPTS="--platform linux/amd64,linux/ppc64le --push" REPO=ghcr.io/${{ github.repository_owner }}/receptor VERSION=v${{ github.event.inputs.version }} LATEST=yes
- name: Stage container image
run: |
docker push ghcr.io/${{ github.repository_owner }}/receptor:v${{ github.event.inputs.version }}
docker push ghcr.io/${{ github.repository_owner }}/receptor:latest
make container CONTAINERCMD="docker buildx" EXTRA_OPTS="--platform linux/amd64,linux/ppc64le --push" REPO=ghcr.io/sunidhi-gaonkar1/receptor VERSION=v${{ github.event.inputs.version }} LATEST=yes
- name: Create draft release
run: |
Expand Down

0 comments on commit 80697b7

Please sign in to comment.