Skip to content

Commit c2a3622

Browse files
committed
Merge remote-tracking branch 'origin' into issue-16-Create_ProgressBar_Component
2 parents f9cc750 + a56e38d commit c2a3622

88 files changed

Lines changed: 3118 additions & 506 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.production.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# FRONTEND
3+
APP_ENV=PRODUCTION
4+
NEXT_PUBLIC_BACKEND_URL="https://robodrone.codersforcauses.com/api"
5+
6+
7+
# BACKEND
8+
APP_NAME=DjangoAPI
9+
API_SECRET_KEY= CHANGE THIS TO A RANDOM STRING
10+
API_ALLOWED_HOSTS=".localhost 127.0.0.1 [::1] .codersforcauses.org"
11+
12+
POSTGRES_HOST=db
13+
POSTGRES_NAME=postgres
14+
POSTGRES_USER=postgres
15+
POSTGRES_PASSWORD=password
16+
POSTGRES_PORT=5432
17+
18+
DJANGO_SUPERUSER_PASSWORD= CHANGE THIS TO A RANDOM STRING
19+
DJANGO_SUPERUSER_EMAIL= CHANGE THIS TO A VALID EMAIL
20+
DJANGO_SUPERUSER_USERNAME= CHANGE THIS TO A VALID USERNAME
21+
22+
FRONTEND_URL="https://robodrone.codersforcauses.com/"

.github/workflows/cd-pipeline.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push-client:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push client image
33+
uses: docker/build-push-action@v5
34+
with:
35+
context: .
36+
file: ./docker/client/Dockerfile
37+
push: ${{ github.event_name != 'pull_request' }}
38+
tags: |
39+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-client:latest
40+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-client:${{ github.sha }}
41+
cache-from: type=gha
42+
cache-to: type=gha,mode=max
43+
platforms: linux/amd64,linux/arm64
44+
45+
- name: Output client image name
46+
if: github.event_name != 'pull_request'
47+
run: |
48+
echo "Client image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-client:latest"
49+
50+
build-and-push-server:
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
54+
packages: write
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Set up Docker Buildx
61+
uses: docker/setup-buildx-action@v3
62+
63+
- name: Log in to Container Registry
64+
uses: docker/login-action@v3
65+
with:
66+
registry: ${{ env.REGISTRY }}
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build and push server image
71+
uses: docker/build-push-action@v5
72+
with:
73+
context: .
74+
file: ./docker/server/Dockerfile
75+
push: ${{ github.event_name != 'pull_request' }}
76+
tags: |
77+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-server:latest
78+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-server:${{ github.sha }}
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
81+
platforms: linux/amd64,linux/arm64
82+
83+
- name: Output server image name
84+
if: github.event_name != 'pull_request'
85+
run: |
86+
echo "Server image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-prod-server:latest"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,5 @@ dist
291291
# misc
292292
.DS_Store
293293

294-
opt/
294+
opt/
295+
/server/static_files

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"typescript.tsdk": "${workspaceFolder}/client/node_modules/typescript/lib",
1010
"shellcheck.ignorePatterns": {
1111
"**/.env*": true
12-
}
12+
},
13+
"editor.formatOnSave": true
1314
}

client/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
REACT_EDITOR=code
22

33
APP_ENV=DEVELOPMENT
4-
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000/api"
4+
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000/api"

client/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ yarn-error.log*
3333

3434
# typescript
3535
*.tsbuildinfo
36-
next-env.d.ts
36+
next-env.d.ts

client/next.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const nextConfig = {
1111
domains: ["squadrone.com.au"],
1212
},
1313
reactStrictMode: true,
14+
images: {
15+
domains: ['localhost', '127.0.0.1', 'squadrone.com.au'],
16+
},
1417
// dumb fix for windows docker
1518
webpack: isWindowsDevContainer()
1619
? (config) => {
@@ -23,4 +26,4 @@ const nextConfig = {
2326
: undefined,
2427
};
2528

26-
export default nextConfig;
29+
export default nextConfig;

client/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/public/ProgressBar1.svg

Lines changed: 5 additions & 0 deletions
Loading

client/public/ProgressBar4.svg

Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)