-
Notifications
You must be signed in to change notification settings - Fork 1
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
9 changed files
with
161 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
call-backend-build: | ||
uses: ./.github/workflows/backend-build.yml | ||
with: | ||
pythonVersion: '3.10' | ||
environment: ${{ github.event_name == 'push' && 'prod' || 'dev' }} | ||
secrets: | ||
SECRET_KEY: ${{ secrets.DJANGO_SECRET }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_STORAGE_BUCKET_NAME: ${{ secrets.AWS_STORAGE_BUCKET_NAME }} | ||
AWS_S3_REGION_NAME: ${{ secrets.AWS_S3_REGION_NAME }} | ||
|
||
call-frontend-build: | ||
uses: ./.github/workflows/frontend-build.yml | ||
with: | ||
nodeVersion: '20.x' |
11 changes: 6 additions & 5 deletions
11
.github/workflows/frontend-ci.yml → .github/workflows/frontend-build.yml
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,84 @@ | ||
name: Deploy Resources | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
deploy-frontend: | ||
name: Deploy Frontend | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the project | ||
run: npm run build | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-southeast-1 | ||
|
||
- name: Install AWS Amplify CLI | ||
run: npm install -g @aws-amplify/cli | ||
|
||
- name: Deploy to Amplify | ||
run: | | ||
amplify init --yes | ||
amplify publish --yes | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: [ deploy-frontend ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Prepare release | ||
id: prep_release | ||
run: | | ||
# Example script to generate tag and release notes, needs to be customized | ||
TAG_NAME=$(git tag --sort=-v:refname | head -n 1 | awk -F '.' '{print $1 "." $2+1}') | ||
if [ -z "$TAG_NAME" ]; then | ||
TAG_NAME="1.0" | ||
fi | ||
RELEASE_NOTES=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline) | ||
if [ -z "$RELEASE_NOTES" ]; then | ||
RELEASE_NOTES="Initial release" | ||
fi | ||
echo "::set-output name=tag_name::$TAG_NAME" | ||
echo "::set-output name=release_notes::$RELEASE_NOTES" | ||
shell: bash | ||
|
||
- name: Create GitHub Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.prep_release.outputs.tag_name }} | ||
release_name: Release ${{ steps.prep_release.outputs.tag_name }} | ||
body: ${{ steps.prep_release.outputs.release_notes }} | ||
draft: false | ||
prerelease: false | ||
|
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
File renamed without changes.
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 |
---|---|---|
|
@@ -82,4 +82,4 @@ export default function BidderLogInPage() { | |
</div> | ||
</div> | ||
); | ||
} | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import { useNavigate } from "react-router"; | ||
import NavBar from '../components/nav-bar/NavBar'; | ||
|
||
export default function HomePage() { | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<div className="App"> | ||
<NavBar /> | ||
<button type="button" className="btn btn-primary" onClick={() => navigate("/onboard")}>Click me</button> | ||
</div> | ||
); | ||
} |
File renamed without changes.