Skip to content

Commit

Permalink
Merge branch 'main' into jvogt/rsvp
Browse files Browse the repository at this point in the history
  • Loading branch information
jvogt23 committed Aug 17, 2024
2 parents 1d503c0 + b7ea5dd commit 5f41ff9
Show file tree
Hide file tree
Showing 188 changed files with 7,065 additions and 8,013 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ vendor/
node_modules/
public/js/
public/css/
storage/*.key
storage/
docs/_build/
resources/test/
20 changes: 18 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_TIMEZONE=UTC
APP_URL=http://localhost:8000

APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack
LOG_STACK=single

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
Expand All @@ -14,8 +25,8 @@ DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
BROADCAST_CONNECTION=log
CACHE_STORE=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

Expand Down Expand Up @@ -44,6 +55,7 @@ CAS_MASQUERADE_givenName=George
CAS_MASQUERADE_sn=Burdell
CAS_MASQUERADE_eduPersonPrimaryAffiliation=student
CAS_MASQUERADE_authnContextClass=mfa-duo
CAS_MASQUERADE_gtAccessCardNumber=000000000

SQUARE_ACCESS_TOKEN=""
SQUARE_LOCATION_ID=""
Expand Down Expand Up @@ -86,3 +98,7 @@ SCOUT_DRIVER=collection

TREASURER_DOCUSIGN_ACCOUNT=[email protected]
TREASURER_DOCUSIGN_NAME="Kristaps Berzinch"

SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
4 changes: 2 additions & 2 deletions .env.testing
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ LOG_CHANNEL=daily
DB_CONNECTION=sqlite
DB_DATABASE=":memory:"

BROADCAST_DRIVER=log
CACHE_DRIVER=array
BROADCAST_CONNECTION=log
CACHE_STORE=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync

Expand Down
28 changes: 28 additions & 0 deletions .github/matchers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"problemMatcher": [
{
"owner": "sphinx-build",
"pattern": [
{
"regexp": "^\\/home\\/runner\\/work\\/apiary\\/apiary\\/([a-zA-Z-\\.\\/]+):(\\d+):\\s+([a-zA-Z]+):\\s+(.+)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
},
{
"owner": "phan",
"pattern": [
{
"regexp": "^([a-zA-Z\\/\\.]+):(\\d+)\\s+([a-zA-Z]+)\\s+(.+)$",
"file": 1,
"line": 2,
"code": 3,
"message": 4
}
]
}
]
}
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Register problem matchers
run: echo "::add-matcher::.github/matchers.json"

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: bcmath, ctype, curl, fileinfo, gd, intl, json, ldap, mbstring, mysqli, openssl, pdo, redis, sqlite3, tokenizer, uuid, xml, zip
coverage: none
env:
Expand Down Expand Up @@ -68,7 +71,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.3'
extensions: bcmath, ctype, curl, fileinfo, gd, intl, json, ldap, mbstring, mysqli, openssl, pdo, redis, sqlite3, tokenizer, uuid, xml, zip
coverage: none
env:
Expand Down Expand Up @@ -127,7 +130,7 @@ jobs:
- name: Build and push
id: build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
tags: registry.bcdc.robojackets.net/apiary:latest
network: host
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/cache-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Remove Caches
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-24.04
steps:
- name: Remove Caches
run: |
set -x
gh extension install actions/gh-actions-cache
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh actions-cache list -R ${{ github.repository }} -B refs/pull/${{ github.event.pull_request.number }}/merge -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/deactivate-enviroments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- cron: '0 20 * * *'

jobs:
deploy:
deactivate-environments:
name: Deactivate Environments
permissions:
id-token: write
Expand All @@ -23,7 +23,7 @@ jobs:
with:
url: https://nomad.bcdc.robojackets.net
jwtGithubAudience: https://nomad.bcdc.robojackets.net
methodName: GitHub
methodName: GitHubActions

- name: Stop test
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
with:
url: https://nomad.bcdc.robojackets.net
jwtGithubAudience: https://nomad.bcdc.robojackets.net
methodName: GitHub
methodName: GitHubActions

- name: Run Nomad job
env:
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Docs
on:
push:
branches:
- main
paths:
- 'docs/'
- 'docs/**'
pull_request:
branches:
- main
paths:
- 'docs/'
- 'docs/**'

jobs:
docs:
Expand All @@ -18,13 +22,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Register problem matchers
run: echo "::add-matcher::.github/matchers.json"

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Setup Poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v3

- name: Cache the virtualenv
uses: actions/cache@v4
Expand All @@ -38,8 +45,8 @@ jobs:
- name: Build Sphinx docs
run: poetry run sphinx-build -M dirhtml . _build

- name: Install and run Vale
run: |
poetry add vale
poetry run vale sync
poetry run vale .
- name: Run Vale
uses: docker://jdkato/vale
with:
entrypoint: /bin/sh
args: -euxc "cd docs && vale sync && vale ."
51 changes: 51 additions & 0 deletions .github/workflows/one-click-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: One-Click Deploy

on:
workflow_dispatch:
inputs:
environment:
description: The image currently running in production will be deployed to the selected environment. Branch picker determines which Nomad job definition is used.
required: true
type: environment

jobs:
find-image-digest:
permissions:
id-token: write
runs-on: ubuntu-latest

outputs:
image_digest: ${{ steps.get-image-digest.outputs.image_digest }}

steps:
- name: Setup Nomad
uses: lucasmelin/[email protected]

- name: Exchange GitHub JWT for Nomad token
uses: RoboJackets/nomad-jwt-auth@main
with:
url: https://nomad.bcdc.robojackets.net
jwtGithubAudience: https://nomad.bcdc.robojackets.net
methodName: GitHubActions

- name: Get production image digest
id: get-image-digest
env:
NOMAD_ADDR: https://nomad.bcdc.robojackets.net
run: >-
echo "image_digest=$(nomad job inspect apiary-production | jq --raw-output .Job.TaskGroups[0].Tasks[0].Config.image | cut -d "@" -f 2)" >> $GITHUB_OUTPUT
deploy:
name: Deploy
needs: [find-image-digest]
uses: ./.github/workflows/deploy.yml
concurrency:
group: deploy-${{ inputs.environment }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
with:
image-digest: ${{ needs.find-image-digest.outputs.image_digest }}
environment: ${{ inputs.environment }}
precompressed-assets: true
Loading

0 comments on commit 5f41ff9

Please sign in to comment.