v4.32.0 #71
Workflow file for this run
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
name: Deploy Production | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
jobs: | |
deploy-prod: | |
name: deploy-prod | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
concurrency: | |
group: ${{ github.ref }}/deploy-prod | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: install nodejs v16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node_cdk_v16-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node_cdk_v16- | |
- name: install cdk npm packages and verify installation | |
working-directory: cdk | |
run: | | |
npm ci | |
$(npm bin)/cdk doctor | |
- name: configure environment | |
shell: bash | |
run: | | |
# configure docker | |
cp -f docker/.env.template docker/.env | |
sed -i.bak -E 's/^(REGISTRY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${REGISTRY}"'\"/' docker/.env | |
sed -i.bak -E 's/^(REPOSITORY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${REPOSITORY}"'\"/' docker/.env | |
env: | |
REGISTRY: ${{ secrets.REGISTRY }} | |
REPOSITORY: ${{ secrets.REPOSITORY }} | |
- name: configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
role-session-name: github-actions | |
aws-region: eu-west-1 | |
- name: build cdk project | |
working-directory: cdk | |
run: | | |
npm run build | |
- name: synthesize cdk stacks | |
working-directory: cdk | |
run: | | |
$(npm bin)/cdk synth *-prod --quiet >/dev/null 2>&1 | |
- name: deploy cdk stacks | |
working-directory: cdk | |
run: | | |
$(npm bin)/cdk deploy *-prod --require-approval=never >/dev/null 2>&1 | |
- name: Notify Zulip | |
uses: zulip/github-actions-zulip/send-message@v1 | |
with: | |
api-key: ${{ secrets.ZULIP_API_KEY }} | |
email: '[email protected]' | |
organization-url: 'https://turina.dvv.fi' | |
to: 'avoindata.fi' | |
type: 'stream' | |
topic: 'Production Deployments' | |
content: 'Production deployment succeeded! (${{ github.event.head_commit.message }})' |