Skip to content

Commit d82f169

Browse files
authored
Merge pull request #450 from Decatur-Robotics/main
Update this development branch here
2 parents 41153c5 + 56f7054 commit d82f169

106 files changed

Lines changed: 6219 additions & 6586 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
tests
3+
.git
4+
.github
5+
.next
6+
.swc
7+
.vscode
8+
coverage
9+
certs
10+
.env
11+
.env.test
12+
tsconfig.tsbuildinfo

.env.production

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Only put NEXT_PUBLIC variables here!
2+
# We have to include these at build time, so this file is used to inject them into the build process.
3+
NEXT_PUBLIC_API_URL=/api/
4+
NEXT_PUBLIC_SLACK_CLIENT_ID=10831824934.7404945710466
5+
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=G-1BFJYBDC76

.env.test

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
NEXT_PUBLIC_API_URL=http://localhost:3000/api
22

3-
DEVELOPER_EMAILS=["test@gmail.com"]
3+
DEVELOPER_EMAILS=["test@gmail.com"]
4+
5+
TOA_URL=https://example.com
6+
TOA_APP_ID=123
7+
TOA_KEY=456
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Dependabot auto-approve
2+
on: pull_request
3+
4+
permissions:
5+
pull-requests: write
6+
7+
jobs:
8+
dependabot:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'Decatur-Robotics/Gearbox'
11+
steps:
12+
- name: Approve a PR
13+
run: gh pr review --approve "$PR_URL"
14+
env:
15+
PR_URL: ${{github.event.pull_request.html_url}}
16+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/cd.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
name: CD
22

3-
on: [workflow_call, workflow_dispatch]
3+
on:
4+
workflow_call:
5+
secrets:
6+
AWS_ACCESS_KEY_ID:
7+
required: true
8+
AWS_SECRET_ACCESS_KEY:
9+
required: true
10+
workflow_dispatch:
411

512
permissions:
613
packages: write
714

815
jobs:
9-
build_and_push:
16+
push:
1017
runs-on: ubuntu-latest
11-
environment: Test
18+
environment: Production
1219
steps:
1320
- name: Checkout
1421
uses: actions/checkout@v4
1522

1623
- name: Set up Docker Buildx
1724
uses: docker/setup-buildx-action@v3
18-
19-
- name: Create certs directory
20-
run: mkdir certs
2125

22-
- name: Build and export
23-
uses: docker/build-push-action@v6
24-
env:
25-
DOCKER_BUILD_SUMMARY: false
26+
- name: Download artifact
27+
uses: actions/download-artifact@v4
2628
with:
27-
tags: ghcr.io/decatur-robotics/gearbox:latest
28-
outputs: type=docker,dest=/tmp/gearbox.tar
29-
context: . # Needed for Docker to find files made during the workflow
30-
29+
name: gearbox
30+
path: /tmp
31+
3132
- name: Load image
3233
run: |
3334
docker load --input /tmp/gearbox.tar
@@ -37,4 +38,13 @@ jobs:
3738
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u decatur-robotics --password-stdin
3839

3940
- name: Push to GHCR
40-
run: docker push ghcr.io/decatur-robotics/gearbox:latest
41+
run: docker push ghcr.io/decatur-robotics/gearbox:latest
42+
43+
- name: Install AWS CLI
44+
uses: unfor19/install-aws-cli-action@v1
45+
46+
- name: Configure AWS
47+
run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} && aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} && aws configure set region us-east-1
48+
49+
- name: Deploy to ECS
50+
run: aws ecs update-service --cluster gearbox --service gearbox --force-new-deployment

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ jobs:
1717
with:
1818
tags: ghcr.io/decatur-robotics/gearbox:latest
1919
outputs: type=docker,dest=/tmp/gearbox.tar
20+
21+
- name: Upload artifact
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: gearbox
25+
path: /tmp/gearbox.tar
2026

2127
unit_test:
2228
runs-on: ubuntu-latest
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Increment Version
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
pull_request_target:
7+
branches: [main]
8+
types: [opened]
9+
10+
jobs:
11+
increment:
12+
runs-on: ubuntu-latest
13+
if:
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.head_ref }} # We need to checkout the head branch, not the temporary merge branch
19+
persist-credentials: false
20+
21+
- name: Setup Node.js environment
22+
uses: actions/setup-node@v4.1.0
23+
24+
- name: Set name
25+
run: git config user.name "Gearbox Bot"
26+
27+
- name: Set email
28+
run: git config user.email "gearbox@decaturrobotics.org"
29+
30+
- name: Increment patch number
31+
run: npm version patch
32+
33+
- name: Push changes
34+
uses: ad-m/github-push-action@v0.8.0
35+
with:
36+
github_token: ${{ secrets.GIT_PUSH_TOKEN }}
37+
branch: ${{ github.head_ref }}

.github/workflows/onpush.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ jobs:
1111
ci:
1212
uses: ./.github/workflows/ci.yml
1313

14-
# cd:
15-
# needs:
16-
# - ci
17-
# uses: ./.github/workflows/cd.yml
14+
cd:
15+
needs:
16+
- ci
17+
uses: ./.github/workflows/cd.yml
18+
secrets:
19+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
20+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ yarn-error.log*
3737
*.tsbuildinfo
3838
next-env.d.ts
3939

40-
/public/sw.js
41-
/public/sw.js.map
42-
/public/workbox-*
43-
/public/fallback-*
40+
/certs/*.*
4441

45-
/certs/*.*
42+
# PWA
43+
public/sw.js
44+
public/swe-worker*

.gitpod.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)