-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2566 from eurodatacube/staging
Production deploy RACE + eodashboard 30.4.2024
- Loading branch information
Showing
60 changed files
with
1,042 additions
and
294 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
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 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 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 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,100 @@ | ||
name: Polar deployment | ||
|
||
on: | ||
push: | ||
branches: [ polar ] | ||
|
||
concurrency: | ||
group: ci-tests-${{ github.ref }}-1 | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# Checkout code | ||
- uses: actions/checkout@v3 | ||
|
||
# Install node | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
cache-dependency-path: app/package-lock.json | ||
|
||
# Build | ||
- name: Build | ||
run: | | ||
cd app/ | ||
npm ci --ignore-scripts | ||
npm run build | ||
# Inject SH Config file | ||
- name: replace instance ID | ||
uses: datamonsters/replace-action@v2 | ||
with: | ||
files: 'app/dist/shConfig.js' | ||
replacements: '$SH_INSTANCE_ID=${{ secrets.SH_INSTANCE_ID }},$SH_INSTANCE_ID_POLAR=${{ secrets.SH_INSTANCE_ID_POLAR }},$GEODB_INSTANCE_ID=${{ secrets.GEODB_INSTANCE_ID }},$LISTMONK_API_KEY=${{ secrets.LISTMONK_API_KEY }},$STAT_API_CLIENT_SECRET=${{ secrets.STAT_API_CLIENT_SECRET }},$STAT_API_CLIENT_ID=${{ secrets.STAT_API_CLIENT_ID }}' | ||
|
||
# Upload build client to S3 | ||
- name: sync client s3 | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --delete --follow-symlinks --exclude 'data/*' --exclude 'eodash-data/*' | ||
env: | ||
SOURCE_DIR: 'app/dist' | ||
DEST_DIR: 'polar' | ||
AWS_REGION: 'eu-central-1' | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
# Upload data to S3 | ||
- name: sync data s3 | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --delete --follow-symlinks | ||
env: | ||
SOURCE_DIR: 'app/dist/data' | ||
DEST_DIR: 'polar/data' | ||
AWS_REGION: 'eu-central-1' | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
# Upload eodashdata to S3 | ||
- name: sync eodashdata s3 | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --delete --follow-symlinks | ||
env: | ||
SOURCE_DIR: 'app/dist/eodash-data' | ||
DEST_DIR: 'polar/eodash-data' | ||
AWS_REGION: 'eu-central-1' | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
# Invalidate Cloudfront | ||
- name: invalidate | ||
uses: chetan/[email protected] | ||
env: | ||
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_POLAR }} | ||
PATHS: '/*' | ||
AWS_REGION: 'eu-central-1' | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
# Send notification | ||
- name: action-slack | ||
uses: 8398a7/[email protected] | ||
with: | ||
status: ${{ job.status }} | ||
author_name: eodash_deploy | ||
fields: repo,message,commit,author,action,eventName,ref,workflow | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: always() |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.