-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -137,4 +140,4 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Documentation | ||
path: docs/build/* | ||
path: docs/build/* |