Skip to content

Commit d325390

Browse files
committed
aws containerized deployment
1 parent 8f82631 commit d325390

File tree

10 files changed

+9588
-175
lines changed

10 files changed

+9588
-175
lines changed

.github/workflows/100-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
ci:
11-
name: ci
1211
runs-on: ubuntu-latest
1312
strategy:
1413
fail-fast: true

.github/workflows/200-cd.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
1-
# TODO - Write deployment as per your requirement
2-
3-
name: cd
1+
name: Deploy
42

53
on:
4+
workflow_run:
5+
workflows: ["Integrate"]
6+
types:
7+
- completed
8+
workflow_dispatch:
69
push:
7-
branches:
8-
- main
9-
- develop
10+
branches: [ "main" ]
1011

1112
jobs:
12-
deploy:
13+
Deploy:
1314
runs-on: ubuntu-latest
15+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
16+
environment: production
1417

1518
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v3
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '8.4'
26+
27+
- name: Install Composer Dependencies
28+
run: |
29+
composer install --no-dev --optimize-autoloader
30+
31+
- name: Set up application
32+
run: |
33+
cp .env.example .env
34+
php artisan key:generate
35+
36+
- name: Set up AWS Credentials
37+
uses: aws-actions/configure-aws-credentials@v2
38+
with:
39+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
40+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41+
aws-region: ${{ vars.AWS_REGION }}
42+
43+
- name: Login to Amazon ECR
44+
id: login-ecr
45+
uses: aws-actions/amazon-ecr-login@v1
1846

19-
- name: Deploy code
20-
run: echo "# TODO - Write deployment as per your requirement"
47+
- name: Build and Push Docker Image
48+
env:
49+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
50+
ECR_REPOSITORY: ${{ vars.AWS_ECR_REPOSITORY }}
51+
IMAGE_TAG: latest
52+
run: |
53+
docker build --platform linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
54+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
This boilerplate fills that gap, providing pre-configured, best-practice-driven strong foundation. That means you _**start fast**_ and _**build right**_ from day one.
2020

21-
2221
## Features
2322

2423
### ✨ Up-to-Date with the Latest Versions
@@ -41,7 +40,13 @@ This boilerplate fills that gap, providing pre-configured, best-practice-driven
4140
- `composer test.feature` — feature tests with a minimum coverage check
4241
- ✔️ Deploy wherever you want
4342
- Production-ready `Dockerfile` (using [serversideup/docker-php](https://serversideup.net/open-source/docker-php)) for containerized deployment
44-
- Deploy job — complete the `.github/workflows/200-cd.yml` and your application is ready to deploy
43+
- By default, the deploy job pushes image to AWS ECR repository. If you initiate an AWS compute service that supports container image (e.g. AppRunner, Lambda or EKS), deployment should work out-of-the-box just by configuring below variables in GitHub.
44+
- `AWS_ACCESS_KEY_ID` _(secret)_
45+
- `AWS_ECR_REGISTRY` _(secret)_
46+
- `AWS_SECRET_ACCESS_KEY` _(secret)_
47+
- `AWS_ECR_REPOSITORY` _(variable)_
48+
- `AWS_REGION` _(variable)_
49+
- Modify `.github/workflows/200-cd.yml` if you don't want AWS containerized deployment.
4550

4651
### ✨ Elegant testing
4752
- ✔️ [PestPHP](https://pestphp.com) configured with `Architecture`, `Unit` & `Feature` test-suites
@@ -71,6 +76,9 @@ You can easily modify this boilerplate to fit your specific requirements.
7176
- [Testing](./docs/300-TESTING.md)
7277
- [Deployment](./docs/400-DEPLOYMENT.md)
7378

79+
## Credits
80+
[![aws](https://avatars.githubusercontent.com/u/2232217?s=48&v=4)](https://github.com/aws)   
81+
[![serversideup/docker-php](https://avatars.githubusercontent.com/u/4761291?s=48&v=4)](https://github.com/serversideup/docker-php)
7482

7583
## Contributing
7684
- [Issues](https://github.com/laralaunch/the-boilerplate/issues) 👉 for bugs

_ide_helper.php

Lines changed: 14 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/**
77
* A helper file for Laravel, to provide autocomplete information to your IDE
8-
* Generated for Laravel 11.40.0.
8+
* Generated for Laravel 11.41.3.
99
*
1010
* This file should not be included in your code, only analyzed by your IDE!
1111
*
@@ -6345,145 +6345,6 @@ public static function flushMacros()
63456345

63466346
}
63476347
/**
6348-
*
6349-
*
6350-
* @see \Illuminate\Encryption\Encrypter
6351-
*/
6352-
class Crypt {
6353-
/**
6354-
* Determine if the given key and cipher combination is valid.
6355-
*
6356-
* @param string $key
6357-
* @param string $cipher
6358-
* @return bool
6359-
* @static
6360-
*/
6361-
public static function supported($key, $cipher)
6362-
{
6363-
return \Illuminate\Encryption\Encrypter::supported($key, $cipher);
6364-
}
6365-
6366-
/**
6367-
* Create a new encryption key for the given cipher.
6368-
*
6369-
* @param string $cipher
6370-
* @return string
6371-
* @static
6372-
*/
6373-
public static function generateKey($cipher)
6374-
{
6375-
return \Illuminate\Encryption\Encrypter::generateKey($cipher);
6376-
}
6377-
6378-
/**
6379-
* Encrypt the given value.
6380-
*
6381-
* @param mixed $value
6382-
* @param bool $serialize
6383-
* @return string
6384-
* @throws \Illuminate\Contracts\Encryption\EncryptException
6385-
* @static
6386-
*/
6387-
public static function encrypt($value, $serialize = true)
6388-
{
6389-
/** @var \Illuminate\Encryption\Encrypter $instance */
6390-
return $instance->encrypt($value, $serialize);
6391-
}
6392-
6393-
/**
6394-
* Encrypt a string without serialization.
6395-
*
6396-
* @param string $value
6397-
* @return string
6398-
* @throws \Illuminate\Contracts\Encryption\EncryptException
6399-
* @static
6400-
*/
6401-
public static function encryptString($value)
6402-
{
6403-
/** @var \Illuminate\Encryption\Encrypter $instance */
6404-
return $instance->encryptString($value);
6405-
}
6406-
6407-
/**
6408-
* Decrypt the given value.
6409-
*
6410-
* @param string $payload
6411-
* @param bool $unserialize
6412-
* @return mixed
6413-
* @throws \Illuminate\Contracts\Encryption\DecryptException
6414-
* @static
6415-
*/
6416-
public static function decrypt($payload, $unserialize = true)
6417-
{
6418-
/** @var \Illuminate\Encryption\Encrypter $instance */
6419-
return $instance->decrypt($payload, $unserialize);
6420-
}
6421-
6422-
/**
6423-
* Decrypt the given string without unserialization.
6424-
*
6425-
* @param string $payload
6426-
* @return string
6427-
* @throws \Illuminate\Contracts\Encryption\DecryptException
6428-
* @static
6429-
*/
6430-
public static function decryptString($payload)
6431-
{
6432-
/** @var \Illuminate\Encryption\Encrypter $instance */
6433-
return $instance->decryptString($payload);
6434-
}
6435-
6436-
/**
6437-
* Get the encryption key that the encrypter is currently using.
6438-
*
6439-
* @return string
6440-
* @static
6441-
*/
6442-
public static function getKey()
6443-
{
6444-
/** @var \Illuminate\Encryption\Encrypter $instance */
6445-
return $instance->getKey();
6446-
}
6447-
6448-
/**
6449-
* Get the current encryption key and all previous encryption keys.
6450-
*
6451-
* @return array
6452-
* @static
6453-
*/
6454-
public static function getAllKeys()
6455-
{
6456-
/** @var \Illuminate\Encryption\Encrypter $instance */
6457-
return $instance->getAllKeys();
6458-
}
6459-
6460-
/**
6461-
* Get the previous encryption keys.
6462-
*
6463-
* @return array
6464-
* @static
6465-
*/
6466-
public static function getPreviousKeys()
6467-
{
6468-
/** @var \Illuminate\Encryption\Encrypter $instance */
6469-
return $instance->getPreviousKeys();
6470-
}
6471-
6472-
/**
6473-
* Set the previous / legacy encryption keys that should be utilized if decryption fails.
6474-
*
6475-
* @param array $keys
6476-
* @return \Illuminate\Encryption\Encrypter
6477-
* @static
6478-
*/
6479-
public static function previousKeys($keys)
6480-
{
6481-
/** @var \Illuminate\Encryption\Encrypter $instance */
6482-
return $instance->previousKeys($keys);
6483-
}
6484-
6485-
}
6486-
/**
64876348
*
64886349
*
64896350
* @see https://carbon.nesbot.com/docs/
@@ -10379,6 +10240,19 @@ public static function addNamespace($namespace, $hint)
1037910240
$instance->addNamespace($namespace, $hint);
1038010241
}
1038110242

10243+
/**
10244+
* Add a new path to the loader.
10245+
*
10246+
* @param string $path
10247+
* @return void
10248+
* @static
10249+
*/
10250+
public static function addPath($path)
10251+
{
10252+
/** @var \Illuminate\Translation\Translator $instance */
10253+
$instance->addPath($path);
10254+
}
10255+
1038210256
/**
1038310257
* Add a new JSON path to the loader.
1038410258
*
@@ -22459,7 +22333,6 @@ class Concurrency extends \Illuminate\Support\Facades\Concurrency {}
2245922333
class Config extends \Illuminate\Support\Facades\Config {}
2246022334
class Context extends \Illuminate\Support\Facades\Context {}
2246122335
class Cookie extends \Illuminate\Support\Facades\Cookie {}
22462-
class Crypt extends \Illuminate\Support\Facades\Crypt {}
2246322336
class Date extends \Illuminate\Support\Facades\Date {}
2246422337
class DB extends \Illuminate\Support\Facades\DB {}
2246522338

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
"license": "MIT",
1111
"require": {
1212
"php": "^8.4",
13-
"laravel/framework": "^11.39",
14-
"laravel/tinker": "^2.9"
13+
"laravel/framework": "^11.39"
1514
},
1615
"require-dev": {
1716
"barryvdh/laravel-ide-helper": "^3.4",
1817
"fakerphp/faker": "^1.23",
1918
"larastan/larastan": "^3.0",
20-
"laravel/pail": "^1.1",
19+
"laravel/tinker": "^2.9",
2120
"laravel/pint": "^1.19",
2221
"mockery/mockery": "^1.6",
2322
"nunomaduro/collision": "^8.1",

0 commit comments

Comments
 (0)