Skip to content

Commit

Permalink
Deploy services
Browse files Browse the repository at this point in the history
  • Loading branch information
ilja-git committed Nov 21, 2023
1 parent 59306f4 commit 2be74c5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ jobs:
compose/tests-all.log
retention-days: 2

tag:
if: ${{ github.ref == 'refs/heads/master' }}
deploy:
#if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs:
- test
Expand Down Expand Up @@ -195,3 +195,26 @@ jobs:
MANIFEST=$(aws ecr batch-get-image --repository-name "oppivelvollisuus/$repository" --image-ids imageTag="${{ github.event.pull_request.head.sha || github.sha }}" --output json | jq --raw-output --join-output '.images[0].imageManifest')
aws ecr put-image --repository-name "oppivelvollisuus/$repository" --image-tag "env-${{ matrix.environment }}" --image-manifest "$MANIFEST"
done
- name: Unset AWS creds env vars
run: |
echo "AWS_ACCESS_KEY_ID=" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=" >> $GITHUB_ENV
echo "AWS_SESSION_TOKEN=" >> $GITHUB_ENV
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: voltti-ci-oppivelvollisuus-${{ matrix.environment }}
role-duration-seconds: 1200

- name: Deploy
run: |
aws ecs update-service \
--cluster "oppivelvollisuus-${{ matrix.environment }}" \
--service "oppivelvollisuus-${{ matrix.environment }}" \
--force-new-deployment
aws ecs wait services-stable \
--cluster "oppivelvollisuus-${{ matrix.environment }}" \
--services "oppivelvollisuus-${{ matrix.environment }}"
3 changes: 3 additions & 0 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ FROM builder

ENV NODE_ENV production

RUN apt-get update \
&& apt-get -y install curl

ARG build=none
ARG commit=none

Expand Down

0 comments on commit 2be74c5

Please sign in to comment.