Skip to content
Open
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ TELESCOPE_EMAIL=

DEMO_MODE=false
DEMO_REPO_URL="https://github.com/JHWelch/ChoreManager"

PROFILE_FILESYSTEM_DISK=public
53 changes: 53 additions & 0 deletions .github/workflows/dploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy to Production

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: deploy-production
cancel-in-progress: true

jobs:
deploy:
environment: Production
name: Deploy to Production
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- id: auth
name: 'Authenticate to Google Cloud'
uses: google-github-actions/auth@v1
with:
create_credentials_file: true
export_environment_variables: true
service_account: ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.GOOGLE_CLOUD_WORKLOAD_IDENTITY_PROVIDER }}

- name: Place .env
run: echo ${{ secrets.ENV }} | base64 -d > .env

- name: Build Docker image
run: |
docker build --platform linux/amd64 \
-t ${{ vars.GOOGLE_CLOUD_REGION }}-docker.pkg.dev/$GCP_PROJECT/chore-manager/chore-manager:${{ github.sha }} \
--file=php.dockerfile .

- name: Push Docker image
run: |
gcloud config set account ${{ secrets.GOOGLE_CLOUD_SERVICE_ACCOUNT }}
gcloud auth configure-docker ${{ vars.GOOGLE_CLOUD_REGION }}-docker.pkg.dev
docker push ${{ vars.GOOGLE_CLOUD_REGION }}-docker.pkg.dev/$GCP_PROJECT/chore-manager/chore-manager:${{ github.sha }}

- name: Deploy to Cloud Run
run: |
gcloud run deploy chore-manager \
--image ${{ vars.GOOGLE_CLOUD_REGION }}-docker.pkg.dev/$GCP_PROJECT/chore-manager/chore-manager:${{ github.sha }} \
--region ${{ vars.GOOGLE_CLOUD_REGION }} \
--project $GCP_PROJECT
100 changes: 0 additions & 100 deletions .github/workflows/qc.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ npm-debug.log
yarn-error.log
.env.testing
/.vscode
gcloud.json
4 changes: 4 additions & 0 deletions .phpactor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "/Applications/Tinkerwell.app/Contents/Resources/phpactor/phpactor.schema.json",
"language_server_phpstan.enabled": false
}
24 changes: 22 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Storage;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Jetstream\HasTeams;
Expand Down Expand Up @@ -77,7 +78,9 @@ class User extends Authenticatable implements FilamentUser
use HasApiTokens;
use HasChoreStreaks;
use HasFactory;
use HasProfilePhoto;
use HasProfilePhoto {
getProfilePhotoUrlAttribute as parentGetProfilePhotoUrlAttribute;
}
use HasTeams;
use HasUnfinishedChoreScopes;
use Notifiable;
Expand Down Expand Up @@ -113,12 +116,29 @@ public function canAccessFilament(): bool

protected static function booted(): void
{
static::addGlobalScope(new OrderByNameScope);
static::addGlobalScope(new OrderByNameScope());
static::created(function ($user) {
UserSetting::create(['user_id' => $user->id]);
});
}

/**
* Get the URL to the user's profile photo.
*
* @return string
*/
public function getProfilePhotoUrlAttribute()
{
if (config('jetstream.profile_photo_disk') !== 'gcs') {
return $this->parentGetProfilePhotoUrlAttribute();
}

return $this->profile_photo_path
? Storage::disk($this->profilePhotoDisk())
->temporaryUrl($this->profile_photo_path, now()->addMinutes(30))
: $this->defaultProfilePhotoUrl();
}

/**
* Get all users with a specific setting.
*
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"league/commonmark": "^2.2",
"livewire/livewire": "^2.11",
"spatie/icalendar-generator": "^2.3",
"spatie/laravel-google-cloud-storage": "^2.2",
"spatie/laravel-ray": "^1.32"
},
"require-dev": {
Expand Down
136 changes: 135 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading