Skip to content

Commit

Permalink
feat: add CI deployment (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
tracetechnical authored Sep 8, 2022
1 parent 8c8d542 commit 97f6b55
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 94 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/build.yaml

This file was deleted.

62 changes: 32 additions & 30 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
name: Deploy

on:
workflow_run:
workflows: [Build Docker Image]
types:
- completed
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
env:
QUALIFIER: "analytics"
AUTH_CLIENT_NAME: ${{ secrets.AUTH_CLIENT_NAME }}
AUTH_CLIENT_SECRET: ${{ secrets.AUTH_CLIENT_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

container:
image: 'ghcr.io/nasa-impact/veda-features-api:latest'
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Bootstrap
shell: bash
run: |
cd /opt
cdk bootstrap --qualifier ${QUALIFIER} --toolkit-stack-name ${QUALIFIER}
- name: Synth
shell: bash
run: |
cd /opt
cdk synth --qualifier ${QUALIFIER} --toolkit-stack-name ${QUALIFIER}
- name: Deploy
shell: bash
- uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
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: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Install cdk
run: npm install -g

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install dependencies
run: |
cd /opt
cdk deploy --qualifier ${QUALIFIER} --toolkit-stack-name ${QUALIFIER}
python -m pip install --upgrade pip
python -m pip install -r requirements-cdk.txt
# Build and Deploy CDK application
- name: Build & Deploy
run: npm run cdk deploy tifeatures-timvt-staging -- --require-approval never
24 changes: 24 additions & 0 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Create tags

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

0 comments on commit 97f6b55

Please sign in to comment.