Skip to content

Commit

Permalink
Update manual-prod-release.yml to use new prod ecr repo
Browse files Browse the repository at this point in the history
Private ecr repo that can be logged in with credentials fetched from arpajs/sa api

Add concurrency so if dev-release and manual-prod-release are done quickly back to back manual-prod-release waits for dev-release
  • Loading branch information
OgreSound committed May 8, 2024
1 parent 5411b24 commit b14a748
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
tags: '**'

concurrency:
group: ${{ github.ref_name }}

jobs:
dev-release:
name: Release to private ECR
Expand Down
34 changes: 16 additions & 18 deletions .github/workflows/manual-prod-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ name: 'Manual Production Release'
on:
workflow_dispatch:
inputs:
tag:
description: "Tag"
required: true
type: string
tag:
description: 'Tag'
required: true
type: string

concurrency:
group: ${{ inputs.tag }}

env:
DEV_IMAGE_NAME: collabora
PROD_IMAGE_NAME: collabora-prod
GITHUB_ACCESS_ROLE: CollaboraGithubActionsAccessRole

jobs:
release:
Expand All @@ -19,27 +27,17 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.UTILITY_ACCOUNT_ID }}:role/CollaboraGithubActionsAccessRole
role-to-assume: arn:aws:iam::${{ secrets.UTILITY_ACCOUNT_ID }}:role/${{ env.GITHUB_ACCESS_ROLE }}
aws-region: eu-north-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Pull private image
run: docker pull ${{ steps.login-ecr.outputs.registry }}/collabora:${{ inputs.tag }}
- name: Configure Public ECR AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.UTILITY_ACCOUNT_ID }}:role/CollaboraPublicGithubActionsAccessRole
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-public-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
run: docker pull ${{ steps.login-ecr.outputs.registry }}/$DEV_IMAGE_NAME:${{ inputs.tag }}
- name: Tag image
run: docker tag ${{ steps.login-ecr.outputs.registry }}/collabora:${{ inputs.tag }} ${{ steps.login-public-ecr.outputs.registry }}/u3p9b9p9/collabora:${{ inputs.tag }}
run: docker tag ${{ steps.login-ecr.outputs.registry }}/$DEV_IMAGE_NAME:${{ inputs.tag }} ${{ steps.login-ecr.outputs.registry }}/$PROD_IMAGE_NAME:${{ inputs.tag }}
- name: Push image
run: docker push ${{ steps.login-public-ecr.outputs.registry }}/u3p9b9p9/collabora:${{ inputs.tag }}
run: docker push ${{ steps.login-ecr.outputs.registry }}/$PROD_IMAGE_NAME:${{ inputs.tag }}
- name: Create Github Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # Pin to commit hash to prevent compromise of third party action
with:
Expand Down

0 comments on commit b14a748

Please sign in to comment.