-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup staging deployment #6
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
72d5d93
Updated submodule .delta/ui
danielfdsilva ea721cb
Prepare staging deployment
danielfdsilva 7ac272b
Update dummy content
danielfdsilva 3bbfd64
Update deploy branch
danielfdsilva 7cc6f80
Add env file and clarify docs
danielfdsilva 8379f29
Update submodule docs
danielfdsilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule ui
updated
from 2e8548 to 67c68c
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,12 @@ | ||
# Title of the application shown on the header and wherever the name is needed. | ||
APP_TITLE=Dashboard Delta | ||
|
||
# Short description used in meta tags. It shows up when the app url is shared. | ||
APP_DESCRIPTION=Earth changing dashboard | ||
|
||
# Email to reach out when an error occurs or the users have questions. | ||
[email protected] | ||
|
||
# If the app is being served in from a subfolder, the domain url must be set. | ||
# For example, if the app is served from /mysite: | ||
# PUBLIC_URL=http://example.com/mysite |
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,95 @@ | ||
# This workflow performs basic checks: | ||
# | ||
# 1. run a preparation step to install and cache node modules | ||
# 2. once prep succeeds, run lint and test in parallel | ||
# | ||
# The checks are skipped on the 'main' branch. The project relies on branch | ||
# protection to avoid pushes straight to 'main'. | ||
|
||
name: Checks | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'main' | ||
|
||
env: | ||
NODE: 16 | ||
|
||
jobs: | ||
prep: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
# Both delta-ui and delta-config are private repos. Since the token issued | ||
# to GH does not have access to the delta-ui submodule, we have to | ||
# manually check it out using a ssh deploy key. | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get submodules | ||
env: | ||
SSH_KEY_SUBMODULE: ${{secrets.DELTA_UI_FETCH_KEY}} | ||
run: | | ||
eval `ssh-agent -s` | ||
ssh-add - <<< "${SSH_KEY_SUBMODULE}"; git submodule update --init --recursive | ||
|
||
- name: Use Node.js ${{ env.NODE }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE }} | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
.delta/ui/node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | ||
|
||
- name: Install | ||
run: ./.delta/setup | ||
|
||
test: | ||
needs: prep | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# See comment on checks-yml - prep step | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get submodules | ||
env: | ||
SSH_KEY_SUBMODULE: ${{secrets.DELTA_UI_FETCH_KEY}} | ||
run: | | ||
eval `ssh-agent -s` | ||
ssh-add - <<< "${SSH_KEY_SUBMODULE}"; git submodule update --init --recursive | ||
|
||
- name: Use Node.js ${{ env.NODE }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE }} | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
.delta/ui/node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | ||
|
||
- name: Install | ||
run: ./.delta/setup | ||
|
||
- name: Test | ||
run: yarn test |
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,97 @@ | ||
name: Deploy Staging - Surge.sh | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
|
||
env: | ||
NODE: 16 | ||
SURGE_STAGING_DOMAIN: https://vizex.surge.sh | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
# See comment on checks-yml - prep step | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get submodules | ||
env: | ||
SSH_KEY_SUBMODULE: ${{secrets.DELTA_UI_FETCH_KEY}} | ||
run: | | ||
eval `ssh-agent -s` | ||
ssh-add - <<< "${SSH_KEY_SUBMODULE}"; git submodule update --init --recursive | ||
|
||
- name: Use Node.js ${{ env.NODE }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE }} | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
.delta/ui/node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | ||
|
||
- name: Cache dist | ||
uses: actions/cache@v2 | ||
id: cache-dist | ||
with: | ||
path: dist | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.workflow }}-${{ github.sha }} | ||
|
||
- name: Install | ||
run: ./.delta/setup | ||
|
||
- name: Build staging | ||
run: yarn stage | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
# See comment on checks-yml - prep step | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get submodules | ||
env: | ||
SSH_KEY_SUBMODULE: ${{secrets.DELTA_UI_FETCH_KEY}} | ||
run: | | ||
eval `ssh-agent -s` | ||
ssh-add - <<< "${SSH_KEY_SUBMODULE}"; git submodule update --init --recursive | ||
- name: Restore node_modules | ||
uses: actions/cache@v2 | ||
id: cache-node-modules | ||
with: | ||
path: | | ||
node_modules | ||
.delta/ui/node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} | ||
|
||
- name: Restore dist cache | ||
uses: actions/cache@v2 | ||
id: cache-dist | ||
with: | ||
path: dist | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.workflow }}-${{ github.sha }} | ||
|
||
- name: Use Node.js ${{ env.NODE }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NODE }} | ||
|
||
- name: Deploy Staging to Surge | ||
run: | | ||
cp ./dist/index.html ./dist/200.html | ||
yarn run surge ./dist ${{ env.SURGE_STAGING_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,10 +1,46 @@ | ||
--- | ||
id: no2 | ||
name: 'Carbon dioxide or not' | ||
name: 'Carbon Dioxide or Some Other Cool Dataset Name' | ||
description: "Sed sed lectus vitae odio vestibulum mattis. Integer iaculis nisl lectus, vel aliquet nulla imperdiet in." | ||
media: | ||
src: ::file ./img-placeholder-3.jpg | ||
alt: Generic placeholder by Unsplash | ||
author: | ||
name: Unsplash | ||
url: https://unsplash.com/ | ||
thematics: | ||
- water | ||
- fire | ||
- agriculture | ||
- air-quality | ||
|
||
layers: | ||
- id: no2-monthly | ||
name: No2 | ||
type: raster | ||
description: no2 dataset | ||
zoomExtent: | ||
- 0 | ||
- 20 | ||
sourceParams: | ||
resampling_method: bilinear | ||
bidx: 1 | ||
color_formula: gamma r 1.05 | ||
colormap_name: coolwarm | ||
rescale: | ||
- 0 | ||
- 1.5e16 | ||
compare: | ||
datasetId: sandbox | ||
layerId: no2-monthly | ||
datetime: | | ||
::js ({ datetime, dateFns }) => { | ||
return dateFns.sub(datetime, { years: 1 }); | ||
} | ||
mapLabel: | | ||
::js ({ datetime, dateFns }) => { | ||
const comparingDate = dateFns.sub(datetime, { years: 1 }); | ||
return `${dateFns.format(datetime, 'LLL yyyy')} - ${dateFns.format(comparingDate, 'LLL yyyy')}`; | ||
} | ||
--- | ||
# NO2 | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vitae ornare lectus, ac accumsan erat. Cras eget eleifend ligula. Curabitur ac nisi tempor, molestie lorem vitae, consectetur turpis. Etiam hendrerit et sapien ac interdum. | ||
|
||
There goes NO2. | ||
Phasellus nec magna tristique, imperdiet mauris hendrerit, posuere sem. Vestibulum in lobortis tortor. |
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,61 @@ | ||
--- | ||
featured: true | ||
id: sandbox | ||
name: Sandbox | ||
description: Travel restrictions and lockdown measures have disrupted the shipping industry and the global economy broadly. NASA researchers are using artificial intelligence to track shipping activities across major ports in the U.S. | ||
media: | ||
src: ::file ./img-placeholder-4.jpg | ||
alt: Generic placeholder by Unsplash | ||
author: | ||
name: Unsplash | ||
url: https://unsplash.com/ | ||
thematics: | ||
- agriculture | ||
- air-quality | ||
|
||
layers: | ||
- id: no2-monthly | ||
name: No2 | ||
type: raster | ||
description: no2 dataset | ||
zoomExtent: | ||
- 0 | ||
- 20 | ||
sourceParams: | ||
resampling_method: bilinear | ||
bidx: 1 | ||
color_formula: gamma r 1.05 | ||
colormap_name: coolwarm | ||
rescale: | ||
- 0 | ||
- 1.5e16 | ||
compare: | ||
datasetId: sandbox | ||
layerId: no2-monthly | ||
datetime: | | ||
::js ({ datetime, dateFns }) => { | ||
return dateFns.sub(datetime, { years: 1 }); | ||
} | ||
mapLabel: | | ||
::js ({ datetime, dateFns }) => { | ||
const comparingDate = dateFns.sub(datetime, { years: 1 }); | ||
return `${dateFns.format(datetime, 'LLL yyyy')} - ${dateFns.format(comparingDate, 'LLL yyyy')}`; | ||
} | ||
- id: nightlights-hd-monthly | ||
name: Nightlights Monthly | ||
type: raster | ||
description: The nightlights dataset | ||
zoomExtent: | ||
- 4 | ||
- 16 | ||
sourceParams: | ||
bidx: 1 | ||
colormap_name: inferno | ||
rescale: | ||
- 0 | ||
- 255 | ||
- id: dev-fail | ||
name: Failing layer | ||
type: raster | ||
--- | ||
# Nightlights |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add documentation about how this pinned commit can be updated for when ui update needs to be deployed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the commit involves knowing how git submodules work and which commit you pin it to, depends on the use case. During development we'll most likely pin this to random branches, but I added some docs explaining what is going on and an example to update from
main
. Should be easy to understand how to apply it to other situations.Let me know what you think @hanbyul-here .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I see. I was not sure where this is done (was thinking if this is saved somewhere in github action config?) , and documentation make it clear where this is done. Thanks!