Skip to content

Commit

Permalink
Merge pull request #26 from yuminn-k/feature/board
Browse files Browse the repository at this point in the history
feat(committee): add email column
  • Loading branch information
yuminn-k authored Sep 5, 2023
2 parents 8eeeec8 + e7af6ad commit 07848d2
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 7 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: docker build ci

on:
push:
tags:
- 'v*'

jobs:
image-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: d556f8
password: ${{ secrets.GH_ACCESS }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/esgforumwebsitedev/esgforum-laravel:latest
ghcr.io/esgforumwebsitedev/esgforum-laravel:${{ env.RELEASE_VERSION }}
ache-from: type=gha # 여기서 gha 는 Guthub Actions 용 캐시를 의미합니다.
cache-to: type=gha,mode=max
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.AWS_HOST }} # EC2 인스턴스 퍼블릭 DNS
username: ec2-user
key: ${{ secrets.AWS_SSH_KEY }} # pem 키--
# 도커 작업
script: |
docker stop esg-backend-laravel
cd ~/app
docker compose-up -d
6 changes: 3 additions & 3 deletions app/Models/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function committeeMembers()
public function committees()
{
return $this->belongsToMany(Committee::class, 'committee_members', 'id2', 'cId')
->withPivot('note')
->withTimestamps();
->withPivot('note')
->withTimestamps();
}
}
}
6 changes: 6 additions & 0 deletions app/Models/Seminar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;

class Seminar extends Model
{
Expand All @@ -21,4 +22,9 @@ class Seminar extends Model
'participation',
'content'
];

public function getCreatedAtAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d H:i:s');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->text('refresh_token')->nullable()->afrer('authority');
$table->text('refresh_token')->nullable()->after('authority');
});
}

Expand All @@ -25,4 +24,4 @@ public function down(): void
$table->dropColumn('refresh_token');
});
}
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('members', function (Blueprint $table) {
$table->string('email')->after('affiliation')->nullable();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('members', function (Blueprint $table) {
$table->dropColumn('email');
});
}
};

0 comments on commit 07848d2

Please sign in to comment.