From 838aefb4d24edb0ad29754b58470622d9f398335 Mon Sep 17 00:00:00 2001 From: Jarold Wong Date: Tue, 5 Dec 2023 16:11:07 -0800 Subject: [PATCH] remove reusable workflow --- .github/workflows/aws.yml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index b1cbd427..547651f8 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -6,22 +6,35 @@ on: name: Push image to ECR and force new ECS deploy jobs: - setup: + deploy: + name: Deploy runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + - name: Copy regional certificate bundle run: 'echo $RDS_US_WEST_2_BUNDLE_PEM | base64 -d > us-west-2-bundle.pem' shell: bash env: RDS_US_WEST_2_BUNDLE_PEM: ${{secrets.RDS_US_WEST_2_BUNDLE_PEM}} - deploy: - needs: setup - uses: ucdavis-lsit/actions/.github/workflows/deploy.yml@main - with: - repo: 'ipa-web-prod' - cluster: 'legacy' - service: 'ipa-web-prod' - secrets: - access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build and redeploy + uses: jaroldwong/ecr-push-and-ecs-deploy@v1 + with: + ecr-registry: ${{ steps.login-ecr.outputs.registry }} + ecr-repository: 'ipa-web-prod' + ecs-cluster: 'legacy' + ecs-service: 'ipa-web-prod'