Skip to content

Commit

Permalink
chore(actions): push image to dockerhub (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-lx authored Oct 18, 2023
1 parent d23c235 commit d3b41e5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/prereleased.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ env:
DOCKER_REPOSITORY: aws-adapter
CONTAINER: aws-adapter-container-image

DOCKERHUB_REGISTRY: ydata
DOCKER_REPOSITORY_PREFIX: aws-adapter

AWS_S3_REGION: ${{ secrets.AWS_S3_REGION }}
SBOM_FILENAME: docker-sbom
NOTION_DATABASE_ID: ${{ secrets.NOTION_REPOS_DATABASE_ID }}
Expand Down Expand Up @@ -149,6 +152,19 @@ jobs:
docker tag ${{ steps.docker_build.outputs.imageId }} ${{ env.DOCKER_IMAGE_TAG }}
docker push ${{ env.DOCKER_IMAGE_TAG }}
- name: Login to Dockerhub Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Push Docker Image
env:
DOCKER_IMAGE_TAG: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKER_REPOSITORY_PREFIX }}-${{ matrix.package }}:${{ needs.prepare.outputs.version }}
run: |
docker tag ${{ steps.docker_build.outputs.imageId }} ${{ env.DOCKER_IMAGE_TAG }}
docker push ${{ env.DOCKER_IMAGE_TAG }}
update-manifests:
name: Update Manifests
Expand Down Expand Up @@ -184,6 +200,25 @@ jobs:
cd ${COMPONENT_PATH}
kustomize edit set image ${CONTAINER_PKG}=${DOCKER_IMAGE_TAG}
- name: setup-yq
uses: chrisdickinson/[email protected]

- name: Change cronjob on metering
if: matrix.package == 'metering'
env:
DOCKER_IMAGE_TAG: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKER_REPOSITORY_PREFIX }}-${{ matrix.package }}:${{ needs.prepare.outputs.version }}
run: |
cd ${COMPONENT_PATH}
yq w -i metering-adapter/base/cronjob.yaml 'spec.jobTemplate.spec.template.spec.containers[0].image' ${DOCKER_IMAGE_TAG}
- name: Change deployment on quota
if: matrix.package == 'quota'
env:
DOCKER_IMAGE_TAG: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.DOCKER_REPOSITORY_PREFIX }}-${{ matrix.package }}:${{ needs.prepare.outputs.version }}
run: |
cd ${COMPONENT_PATH}
yq w -i quota-adapter/base/deployment.yaml 'spec.template.spec.containers[0].image' ${DOCKER_IMAGE_TAG}
- name: Commit and push image update into manifests repo
env:
VERSION: ${{ needs.prepare.outputs.version }}
Expand Down

0 comments on commit d3b41e5

Please sign in to comment.