Skip to content
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

issue/swodlr-ui-124: switch from create react app to Vite #125

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REACT_APP_SWODLR_API_BASE_URI = https://www.example.com
REACT_APP_BASE_REDIRECT_URI = http://localhost:3000/
REACT_APP_EDL_CLIENT_ID = example_client_id
REACT_APP_EDL_BASE_URI = http://thisisa.test/
VITE_SWODLR_API_BASE_URI = https://www.example.com
VITE_BASE_REDIRECT_URI = http://localhost:3000/
VITE_EDL_CLIENT_ID = example_client_id
VITE_EDL_BASE_URI = http://thisisa.test/
32 changes: 11 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
github_sha: ${{ steps.update-sha.outputs.github_sha }}
software_version: ${{ steps.update-sha.outputs.software_version }}
steps:
- uses: getsentry/action-github-app-token@v2
- uses: getsentry/action-github-app-token@v3
name: my-app-install token
id: podaac-cicd
with:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
VENUE=$(echo "${{ env.TARGET_ENV }}" | tr '[:upper:]' '[:lower:]')
echo "deploy_env_lower=$VENUE" >> $GITHUB_OUTPUT
## Build
- uses: hashicorp/setup-terraform@v2
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
--org=${{ secrets.SNYK_ORG_ID }}
--project-name=${{ github.repository }}
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
- name: NPM install & NPM Lint
Expand All @@ -166,30 +166,21 @@ jobs:
npm install
npm run build
- name: Upload package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: build/*
- name: Generate GitHub App Token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Commit Version Bump
# If building an alpha, release candidate, or release then we commit the version bump back to the repo
if: |
steps.alpha.conclusion == 'success' ||
steps.rc.conclusion == 'success' ||
steps.release.conclusion == 'success'
run: |
git config user.name "PODAAC-CICD"
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
echo "machine github.com login x-access-token password ${{ steps.generate_token.outputs.token }}" > ~/.netrc
git commit -am "/version ${{ env.software_version }}"
git push
env:
GH_APP_TOKEN: ${{ steps.generate_token.outputs.token }}
- name: Push Tag
if: |
steps.alpha.conclusion == 'success' ||
Expand All @@ -198,9 +189,8 @@ jobs:
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

git tag -a "${{ env.software_version }}" -m "Version ${{ env.software_version }}" --force
git push origin "${{ env.software_version }}" --force
git tag -a "${{ env.software_version }}" -m "Version ${{ env.software_version }}"
git push origin "${{ env.software_version }}"
- name: Create GH release
if: |
steps.alpha.conclusion == 'success' ||
Expand Down Expand Up @@ -240,7 +230,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ needs.build.outputs.github_sha }}
- uses: hashicorp/setup-terraform@v2
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
Expand All @@ -263,7 +253,7 @@ jobs:
export TF_VAR_cloudfront_allow_vpcs=${{ secrets.EDC_INTERNET_SERVICES_VPCS }}
./bin/deploy.sh --app-version ${{ needs.build.outputs.software_version }} --tf-venue $VENUE
echo "SWODLR_UI_BUCKET=$(terraform output -raw swodlr-bucket-name)" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
id: download
with:
name: build
Expand Down Expand Up @@ -295,7 +285,7 @@ jobs:
VERSION=${{ needs.build.outputs.software_version }}
echo "SUBMODULE_VERSION=$VERSION">>$GITHUB_ENV
- name: Send notifications to slack
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.NOTIFICATION_WEBHOOK_SWODLR }}
with:
Expand All @@ -305,7 +295,7 @@ jobs:
}
- name: Send failure notifications to slack
if: failure()
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.NOTIFICATION_WEBHOOK_SWODLR }}
with:
Expand Down
11 changes: 6 additions & 5 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="manifest" href="/manifest.json" />

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.min.css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css"/>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
Notice the use of in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
Expand All @@ -32,6 +32,7 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down
Loading