Feature/schema (#95) #52
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
# This is the main build pipeline that verifies and publishes the software | |
name: Environment Deployments | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push events | |
push: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: 1.3.2 | |
- name: Install Software | |
run: | | |
poetry build | |
poetry install | |
- name: Run Tests | |
run: | | |
poetry run flake8 podaac | |
poetry run pylint podaac | |
poetry run pytest | |
# First job in the workflow installs and verifies the software | |
deploy_sit: | |
name: Deploy SIT | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_SIT }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_SIT }} | |
aws-region: us-west-2 | |
role-session-name: GitHubActions | |
- run: aws sts get-caller-identity | |
- name: Sync S3 | |
run: | | |
aws s3 sync ./config-files s3://podaac-services-sit-hitide/dataset-configs --delete --metadata githash=${GITHUB_SHA} | |
aws s3 sync ./palettes s3://podaac-services-sit-hitide/palettes --delete --metadata githash=${GITHUB_SHA} | |
deploy_uat: | |
name: Deploy UAT | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_UAT }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_UAT }} | |
aws-region: us-west-2 | |
role-session-name: GitHubActions | |
- run: aws sts get-caller-identity | |
- name: Sync S3 | |
run: | | |
aws s3 sync ./config-files s3://podaac-services-uat-hitide/dataset-configs --delete --metadata githash=${GITHUB_SHA} | |
aws s3 sync ./palettes s3://podaac-services-uat-hitide/palettes --delete --metadata githash=${GITHUB_SHA} | |
deploy_ops: | |
name: Deploy OPS | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_OPS }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_OPS }} | |
aws-region: us-west-2 | |
role-session-name: GitHubActions | |
- run: aws sts get-caller-identity | |
- name: Sync S3 | |
run: | | |
aws s3 sync ./config-files s3://podaac-services-ops-hitide/dataset-configs --delete --metadata githash=${GITHUB_SHA} | |
aws s3 sync ./palettes s3://podaac-services-ops-hitide/palettes --delete --metadata githash=${GITHUB_SHA} |