From 4c1a8c31ca198fa1160710c173d2791a46c4abeb Mon Sep 17 00:00:00 2001 From: Simon Liu <69875423+sliu008@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:00:00 -0800 Subject: [PATCH] Feature/new deployment (#60) * add a new workflow that deploys and sync files to all env when merge to main * update changelog * update workflow * update workflow --- .github/workflows/deploy.yml | 41 ++++++++++++++++++++++++++++++++++++ .gitignore | 1 + CHANGELOG.md | 1 + 3 files changed, 43 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8b7d4b0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,41 @@ +# 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: + # 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 + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + ## Deployment + - name: Set AWS Env Variables + run: echo "AWS_ACCESS_KEY_ID= ${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_SIT }} >> $GITHUB_ENV | + echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_SIT }} >> $GITHUB_ENV + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_SERVICES_SIT }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_SERVICES_SIT }} + with: + 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} diff --git a/.gitignore b/.gitignore index b6e4761..4089060 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ dmypy.json # Pyre type checker .pyre/ +.DS_STORE diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e59fd6..2cb5fdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Add new deploy workflow to deploy to all env when merge to main ### Changed ### Deprecated ### Removed