-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
977 additions
and
564 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- test | ||
authors: | ||
- dependabot | ||
- github-actions | ||
categories: | ||
- title: New Features | ||
labels: | ||
- requirement | ||
- epic | ||
- title: Enhancements | ||
labels: | ||
- enhancement | ||
- performance | ||
- title: Bug Fixes | ||
labels: | ||
- bug | ||
- title: Clean-up | ||
labels: | ||
- cleanup | ||
- technical debt | ||
- title: Other Changes | ||
labels: | ||
- "*" |
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,44 @@ | ||
name: Build DGIdb React Frontend | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build_frontend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- run: npm install -g yarn | ||
working-directory: ./client | ||
|
||
- run: yarn install | ||
working-directory: ./client | ||
|
||
- run: rm -rf public/* | ||
working-directory: ./server | ||
|
||
- run: CI=false yarn build:${{ inputs.branch == 'main' && 'prod' || inputs.branch }} | ||
working-directory: ./client | ||
|
||
- run: cp -r ../../client/build/* . | ||
working-directory: ./server/public | ||
|
||
- name: Commit and push build | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: server/public/* | ||
push: origin ${{ inputs.branch }} | ||
message: Automated frontend build |
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,48 @@ | ||
name: Deploy DGIdb | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
required: true | ||
type: string | ||
secrets: | ||
SSH_HOST: | ||
required: true | ||
SSH_KEY: | ||
required: true | ||
|
||
jobs: | ||
deploy: | ||
name: Capistrano Deploy to Server | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install SSH key to Server | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_KEY }} | ||
name: github-actions | ||
known_hosts: 'random-placeholder-value-replaced-by-keyscan-below' | ||
if_key_exists: replace | ||
config: | | ||
host ${{ secrets.SSH_HOST }} | ||
IdentityFile ~/.ssh/github-actions | ||
IdentitiesOnly yes | ||
ForwardAgent yes | ||
- name: Adding Known Hosts | ||
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
working-directory: ./server | ||
ruby-version: '3.1' | ||
bundler-cache: true | ||
|
||
- name: Deploy | ||
working-directory: ./server | ||
run: | | ||
eval "$(ssh-agent -s)" | ||
ssh-add ~/.ssh/github-actions | ||
bundle exec cap ${{ inputs.environment }} deploy |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Build and deploy production | ||
|
||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
build-production: | ||
uses: dgidb/dgidb-v5/.github/workflows/build_client.yml@main | ||
with: | ||
branch: main | ||
deploy-production: | ||
uses: dgidb/dgidb-v5/.github/workflows/deploy.yml@main | ||
needs: build-production | ||
with: | ||
environment: production | ||
secrets: | ||
SSH_HOST: ${{ secrets.DGIDB_PRODUCTION_SSH_HOST }} | ||
SSH_KEY: ${{ secrets.DGIDB_PRODUCTION_SSH_KEY }} | ||
|
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,19 @@ | ||
name: Build and deploy staging | ||
|
||
on: | ||
push: | ||
branches: [staging] | ||
jobs: | ||
build-staging: | ||
uses: dgidb/dgidb-v5/.github/workflows/build_client.yml@main | ||
with: | ||
branch: staging | ||
deploy-staging: | ||
uses: dgidb/dgidb-v5/.github/workflows/deploy.yml@main | ||
needs: build-staging | ||
with: | ||
environment: staging | ||
secrets: | ||
SSH_HOST: ${{ secrets.DGIDB_STAGING_SSH_HOST }} | ||
SSH_KEY: ${{ secrets.DGIDB_STAGING_SSH_KEY }} | ||
|
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,3 +1,3 @@ | ||
REACT_APP_API_URI="http://dgidb-prod.us-east-2.elasticbeanstalk.com/api/graphql" | ||
REACT_APP_API_URI="https://beta.dgidb.org/api/graphql" | ||
|
||
PORT=3001 | ||
PORT=443 |
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,3 +1,3 @@ | ||
REACT_APP_API_URI="http://dgidb-prod.us-east-2.elasticbeanstalk.com/api/graphql" | ||
REACT_APP_API_URI="https://beta.dgidb.org/api/graphql" | ||
|
||
PORT=3001 | ||
PORT=443 |
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
8 changes: 8 additions & 0 deletions
8
client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss
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,8 @@ | ||
.release-info { | ||
font-size: 16px; | ||
|
||
a { | ||
color: white; | ||
text-decoration: underline; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
client/src/components/Shared/ReleaseInformation/ReleaseInformation.tsx
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,51 @@ | ||
import './ReleaseInformation.scss'; | ||
import React, { useState, useEffect } from 'react'; | ||
|
||
const ReleaseInformation: React.FC = () => { | ||
interface GithubRelease { | ||
html_url: string; | ||
name: string; | ||
published_at: string; | ||
} | ||
|
||
const [currentRelease, setCurrentRelease] = useState< | ||
GithubRelease | undefined | ||
>(undefined); | ||
|
||
const fetchRelease = async () => { | ||
const response = await fetch( | ||
'https://api.github.com/repos/dgidb/dgidb-v5/releases?per_page=1' | ||
); | ||
if (response.ok) { | ||
const body = await response.json(); | ||
setCurrentRelease(body[0]); | ||
} else { | ||
setCurrentRelease(undefined); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
fetchRelease(); | ||
}, []); | ||
|
||
return ( | ||
<div> | ||
{currentRelease && ( | ||
<div className="release-info"> | ||
DGIdb {currentRelease.name} ( | ||
{new Date(currentRelease.published_at).toLocaleString().split(',')[0]} | ||
) • | ||
<a href={currentRelease.html_url} target="_blank"> | ||
Release Notes | ||
</a> | ||
• | ||
<a href="https://github.com/dgidb/dgidb-v5/releases/" target="_blank"> | ||
History | ||
</a> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReleaseInformation; |
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.