Skip to content

Commit

Permalink
DP-187 (WIP) update
Browse files Browse the repository at this point in the history
  • Loading branch information
webit4me committed Jul 13, 2024
1 parent 7186c69 commit ff7b02b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/main-build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Save Docker Images
run: |
docker save -o cdp-images.tar cabinetoffice/cdp-organisation-information-migrations:latest cabinetoffice/cdp-data-sharing:latest cabinetoffice/cdp-entity-verification cabinetoffice/cdp-forms:latest cabinetoffice/cdp-organisation-app:latest cabinetoffice/cdp-organisation:latest cabinetoffice/cdp-person:latest cabinetoffice/cdp-tenant:latest cabinetoffice/cdp-authority:latest
docker save -o cdp-images.tar cabinetoffice/cdp-organisation-information-migrations:latest cabinetoffice/cdp-data-sharing:latest cabinetoffice/cdp-entity-verification:latest cabinetoffice/cdp-forms:latest cabinetoffice/cdp-organisation-app:latest cabinetoffice/cdp-organisation:latest cabinetoffice/cdp-person:latest cabinetoffice/cdp-tenant:latest cabinetoffice/cdp-authority:latest
- name: Upload Docker Images as Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -99,27 +99,30 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Generate Image Version
id: image_version
run: |
IMAGE_VERSION=$(date +%Y%m%d)-$(git rev-parse --short HEAD)
echo "IMAGE_VERSION=$IMAGE_VERSION" >> $GITHUB_ENV
- name: Tag and Push Docker Images
run: |
IMAGE_VERSION=$(date +%Y%m%d%H%M%S)
for image in cabinetoffice/cdp-organisation-information-migrations cabinetoffice/cdp-data-sharing cabinetoffice/cdp-entity-verification cabinetoffice/cdp-forms cabinetoffice/cdp-organisation-app cabinetoffice/cdp-organisation cabinetoffice/cdp-person cabinetoffice/cdp-tenant cabinetoffice/cdp-authority; do
CLEAN_IMAGE_NAME=$(echo $image | sed 's/^cabinetoffice\///')
docker tag $image:latest ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/$CLEAN_IMAGE_NAME:$IMAGE_VERSION
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/$CLEAN_IMAGE_NAME:$IMAGE_VERSION
docker tag $image:latest ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/$CLEAN_IMAGE_NAME:${{ env.IMAGE_VERSION }}
docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-west-2.amazonaws.com/$CLEAN_IMAGE_NAME:${{ env.IMAGE_VERSION }}
done
- name: Create Git Tag
run: |
IMAGE_VERSION=$(date +%Y%m%d%H%M%S)
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git tag ${IMAGE_VERSION}
git push origin ${IMAGE_VERSION}
git tag ${{ env.IMAGE_VERSION }}
git push origin ${{ env.IMAGE_VERSION }}
- name: Store Version in SSM Parameter Store
run: |
IMAGE_VERSION=$(date +%Y%m%d%H%M%S)
aws ssm put-parameter --name "cdp-sirsi-service-version" --value "${IMAGE_VERSION}" --type String --overwrite
aws ssm put-parameter --name "cdp-sirsi-service-version" --value "${{ env.IMAGE_VERSION }}" --type String --overwrite
document:
runs-on: ubuntu-latest
Expand All @@ -137,4 +140,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Documentation
path: docs/build/*
path: docs/build/*

0 comments on commit ff7b02b

Please sign in to comment.