Skip to content

Commit

Permalink
feat(workflow): Update stage to stage image from single build point
Browse files Browse the repository at this point in the history
It's not good practice to rebuild images as the scenario exists where the same code base builds different images. As such only use images from a single build point.

1. Pulls the image that matches the git commit
2. Tag image with the specified version and push to ghcr

Issue #31
  • Loading branch information
jon-nfc committed Jan 8, 2024
1 parent 96fcd27 commit 506369a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ jobs:
run: |
python3 -m pip install docker
- name: Log in to GHCR
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and stage awx-operator
working-directory: awx-operator
- name: Log into registry ghcr.io
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- name: Stage awx-operator
run: |
BUILD_ARGS="--build-arg DEFAULT_AWX_VERSION=${{ github.event.inputs.default_awx_version }} \
--build-arg OPERATOR_VERSION=${{ github.event.inputs.version }}" \
IMAGE_TAG_BASE=ghcr.io/${{ github.repository_owner }}/awx-operator \
VERSION=${{ github.event.inputs.version }} make docker-build docker-push
docker buildx imagetools create ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }} --tag ghcr.io/${{ github.repository_owner }}/awx-operator:${{ github.event.inputs.version }}
- name: Run test deployment
working-directory: awx-operator
Expand Down

0 comments on commit 506369a

Please sign in to comment.