-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci) add action to deploy stac-admin demo on branch
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Stac-Admin Demo - Limited Test and Deploy Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- demo/stac-admin | ||
|
||
jobs: | ||
|
||
test-demo: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -e .[dev,deploy,test] | ||
- name: Launch services | ||
run: AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} docker compose up --build -d | ||
|
||
- name: Ingest Stac Items/Collection | ||
run: | | ||
./scripts/load-data-container.sh | ||
- name: Sleep for 10 seconds | ||
run: sleep 10s | ||
shell: bash | ||
|
||
- name: Integrations tests | ||
run: python -m pytest .github/workflows/tests/ -vv -s | ||
|
||
- name: Stop services | ||
run: docker compose stop | ||
|
||
deploy-demo: | ||
needs: [test-demo] | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 17 | ||
|
||
- name: Configure awscli | ||
uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- name: Install CDK | ||
run: npm install -g aws-cdk@2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -e .[dev,deploy,test] | ||
- name: Get dev environment configuration for develop branch | ||
run: ./scripts/get-env.sh "veda-backend-uah-stacadmin-demo-env" | ||
|
||
- name: Deploy | ||
run: | | ||
echo $STAGE | ||
cdk deploy --require-approval never --outputs-file ${HOME}/cdk-outputs.json |