add new traffic station type TrafficDirection #92
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: CI/CD | |
on: | |
push: | |
pull_request: | |
env: | |
AWS_REGION : "eu-west-1" | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: clone into repo | |
uses: actions/checkout@v2 | |
- name: Test | |
run: | | |
cd src/main/webapp | |
test -f index.html | |
test -f dotenv.js | |
deploy-test: | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/main' | |
needs: test | |
concurrency: deploy-test | |
env: | |
AWS_S3_BUCKET_NAME : 'odh.analytics-test' | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_ENDPOINT_URL: "https://analytics.opendatahub.testingmachine.eu" | |
X_THUNDERFOREST_MAP_API_KEY: ${{ secrets.THUNDERFOREST_API_KEY }} | |
X_ODH_MOBILITY_API_URI: "https://mobility.api.opendatahub.testingmachine.eu/v2" | |
X_KEYCLOAK_AUTHORIZATION_URI: "https://auth.opendatahub.testingmachine.eu/auth" | |
X_KEYCLOAK_REALM: "noi" | |
X_KEYCLOAK_CLIENT_ID: "odh-mobility-analytics" | |
X_KEYCLOAK_REDIRECT_URI: "https://analytics.opendatahub.testingmachine.eu/" | |
X_KEYCLOAK_SILENT_CHECK_SSO_REDIRECT_URI: "https://analytics.opendatahub.testingmachine.eu/callback.html" | |
- name: Run dotenv-sed.sh | |
run: cd infrastructure && ./dotenv-sed.sh | |
- name: Sync to S3 bucket | |
uses: noi-techpark/github-actions/aws-s3-bucket-sync@v2 | |
with: | |
access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
region: ${{ env.AWS_REGION }} | |
s3-bucket-name: ${{ env.AWS_S3_BUCKET_NAME }} | |
folder: ./src/main/webapp | |
deploy-prod: | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/prod' | |
needs: test | |
concurrency: deploy-prod | |
env: | |
AWS_S3_BUCKET_NAME : 'odh.analytics-prod' | |
SCRIPTS_HOST: 'https://scripts.opendatahub.com' | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Create .env file | |
uses: noi-techpark/github-actions/env-file@v2 | |
env: | |
X_ENDPOINT_URL: "https://analytics.opendatahub.com" | |
X_THUNDERFOREST_MAP_API_KEY: ${{ secrets.THUNDERFOREST_API_KEY }} | |
X_ODH_MOBILITY_API_URI: "https://mobility.api.opendatahub.com/v2" | |
X_KEYCLOAK_AUTHORIZATION_URI: "https://auth.opendatahub.com/auth" | |
X_KEYCLOAK_REALM: "noi" | |
X_KEYCLOAK_CLIENT_ID: "odh-mobility-analytics" | |
X_KEYCLOAK_REDIRECT_URI: "https://analytics.opendatahub.com/" | |
X_KEYCLOAK_SILENT_CHECK_SSO_REDIRECT_URI: "https://analytics.opendatahub.com/callback.html" | |
- name: Change scripts host to prod | |
run: sed -i -e "s%https://scripts.opendatahub.testingmachine.eu%${{env.SCRIPTS_HOST}}%g" src/main/webapp/index.html | |
- name: Run dotenv-sed.sh | |
run: cd infrastructure && ./dotenv-sed.sh | |
- name: Sync to S3 bucket | |
uses: noi-techpark/github-actions/aws-s3-bucket-sync@v2 | |
with: | |
access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }} | |
region: ${{ env.AWS_REGION }} | |
s3-bucket-name: ${{ env.AWS_S3_BUCKET_NAME }} | |
folder: ./src/main/webapp |