From 7583c94cbfa8e9b3facd6c7346ba1c70e405edd6 Mon Sep 17 00:00:00 2001 From: Juhyeon Lee Date: Mon, 4 Sep 2023 20:06:18 +0900 Subject: [PATCH 1/5] Create main.yml --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cd5ca9e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +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 From 3c59bcc6d183d45ad70a4193d46cad70ce8b5af7 Mon Sep 17 00:00:00 2001 From: Juhyeon Lee Date: Mon, 4 Sep 2023 22:49:36 +0900 Subject: [PATCH 2/5] Update main.yml --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cd5ca9e..9d330b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,3 +33,14 @@ jobs: 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 From dbc5dbd430e670944ca48061a7c57dba483f1c81 Mon Sep 17 00:00:00 2001 From: devYuMinKim Date: Tue, 5 Sep 2023 11:24:29 +0900 Subject: [PATCH 3/5] feat(committee): add email column --- app/Models/Member.php | 6 ++--- ...9_04_233932_add_email_to_members_table.php | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2023_09_04_233932_add_email_to_members_table.php diff --git a/app/Models/Member.php b/app/Models/Member.php index 27ea230..b07bec6 100644 --- a/app/Models/Member.php +++ b/app/Models/Member.php @@ -19,7 +19,7 @@ public function committeeMembers() public function committees() { return $this->belongsToMany(Committee::class, 'committee_members', 'id2', 'cId') - ->withPivot('note') - ->withTimestamps(); + ->withPivot('note') + ->withTimestamps(); } -} +} \ No newline at end of file diff --git a/database/migrations/2023_09_04_233932_add_email_to_members_table.php b/database/migrations/2023_09_04_233932_add_email_to_members_table.php new file mode 100644 index 0000000..c6f13e5 --- /dev/null +++ b/database/migrations/2023_09_04_233932_add_email_to_members_table.php @@ -0,0 +1,27 @@ +string('email')->after('affiliation')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('members', function (Blueprint $table) { + $table->dropColumn('email'); + }); + } +}; \ No newline at end of file From 721837ba7cc9befa9729636417a0c597a32f198e Mon Sep 17 00:00:00 2001 From: devYuMinKim Date: Tue, 5 Sep 2023 11:48:11 +0900 Subject: [PATCH 4/5] refactor(board): modify Date Representation Form --- app/Models/Seminar.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/Seminar.php b/app/Models/Seminar.php index 79759cd..6926c41 100644 --- a/app/Models/Seminar.php +++ b/app/Models/Seminar.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Carbon\Carbon; class Seminar extends Model { @@ -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'); + } } \ No newline at end of file From 121ce0ebbb4e6994effe4c084d02cfd59e10cf36 Mon Sep 17 00:00:00 2001 From: devYuMinKim Date: Tue, 5 Sep 2023 11:48:30 +0900 Subject: [PATCH 5/5] refactor(migration): modify wrong letter --- .../2023_07_22_093009_add_refresh_token_to_users_table.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/database/migrations/2023_07_22_093009_add_refresh_token_to_users_table.php b/database/migrations/2023_07_22_093009_add_refresh_token_to_users_table.php index 753f6e0..7c495f9 100644 --- a/database/migrations/2023_07_22_093009_add_refresh_token_to_users_table.php +++ b/database/migrations/2023_07_22_093009_add_refresh_token_to_users_table.php @@ -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'); }); } @@ -25,4 +24,4 @@ public function down(): void $table->dropColumn('refresh_token'); }); } -}; +}; \ No newline at end of file