-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
216 changed files
with
8,384 additions
and
2,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eyJpdiI6IlpDaHdJZk1UUHdQVFZVRGlpTVVwMFE9PSIsInZhbHVlIjoibDRveWQ1UEFoOVNHam9MNDFoakhSNW9qeHFnRjJzZzY2UVRxYnJHclcwRVZtSnhxVGQxNS9sMFRGODA3eTRJT2tlNFV6Ny9mZG9yQ0ZLTms1Vld6RytWRGtkNTVxTGNBbzhSSHJHYktBR3lyaWJsRk9mRjFDQ1V5SGVaU1JDdDJacXVBRUh0ZWFJb1p4M0ZPTGI1SWJtdzBwQnphWCswSlZROXQ4T0U4NmYrcjE2ak1xbENMUDVYbzF0RzNCRUVsN21lQVRsajEweFdDdjlZSC9kYkRQdVJOMEVrNG5uc3Uvd2Q1b2IrMmhsQnlBNWpZUG83WkJyb09xNmtFYVNUd1BJTWdMN0FLOENlUjhFZGxyNlFXRThXMjd2aFdHNkhEY0JyUW9mdDQ1c3ptekFTSndQeUUxQ2FxSnhYUHllMm1QejNwbDVQZlUxcGhQTEV2ZXpsaUh0Y1Ywc2NWVTkyQXJKcHdPcTFDc3RvcVEvaWtBcCtUZ0dnNVlXYzFVNmZjN2gveGJmV2t4N0lhNHQ4bDhGVzc4dmxqWVhjYW1YUURiUjRCNk13VVZQMjNmVi9tMmtDaEVrN1JJSDI0ZFNXMFYwTXE2RkpDZG1jQ0txUUE3M0QyTUFXTlFLRWlpaVlRNnE1cGtIRCt5QlR2K01vK2tjVXhPck10SmxiV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lXbVVkdFh3NDlFdUZ4aGR2TzNHYWdwUUFLOG0vQ2JWUWdpaXBzUCtRNTRqTlBEeHdCcnlGTWJ3VWNSSEsyeGdwRHRSWnJiSkptNm9oY0EzNm9lTk1MeDZrWGpZQWZKV1BTbnVmbUhkZzlTaUM1WXpOaXJaaVc3UUI5alM2ck5vS0hnSEMzeDV1V2gzc2VLck5YZkFtVzVFMHY5SzFFQnQrRndNdncvVmNwVW9ldTZjSDB3VW9CNldoVHg0VG5qYS9LME01ZzlXR0VhL3MvbHZ2WU1PWlh3V1MzdG5SemJoYXU0UTBwS0xma0VUeWJGZ0VvQSt6S0lRaHNvd3FGRTZRTEwwU05qekNTaDdiZU5pQlRpOFg3NkltUDdIcVY5OWFLZGJYRzlMNU1nWmZ3RVBEWUd0em4yK205Uk9PK1EvSjBIRlY1ZlBBQWh4cXlYTmJOVDZCZ0VtY2l4TGpXVWJYdk85UlFRNldRT0tDL1UxOUtmdGhIVDU2aERqVUNtNW9ma01EeTNab2lLU1hudzgzYzlQeHJXOUJyTDIrR2Y5WUZiTjhESHdVKzNBci9tZUs4TE1pWWZNMENLVENrMjRYR2hON3JveGhSOUg2WjhDRk1iREhFUSIsIm1hYyI6IjNlZmFmNzU1YjUzMGU0NWJlMTBkNTZiMjcxN2ViYjhhOGM0MDkyNmJkODIwZGU0NmMzZTgyODY0ZDVhMzEzNzMiLCJ0YWciOiIifQ== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: Test and Deploy Application | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@master | ||
with: | ||
php-version: 8.3 | ||
extensions: mbstring, ctype, fileinfo, openssl, PDO, bcmath, json, tokenizer, xml | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Composer install | ||
run: | | ||
composer install --no-interaction --prefer-dist --optimize-autoloader | ||
- name: Install Dependencies | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Stan | ||
run: | | ||
make stan | ||
- name: Tests | ||
run: | | ||
touch database/database.sqlite | ||
make test | ||
create-deployment-matrix: | ||
name: Create deployment matrix | ||
runs-on: ubuntu-latest | ||
needs: ci | ||
outputs: | ||
DEPLOYMENT_MATRIX: ${{ steps.export-deployment-matrix.outputs.DEPLOYMENT_MATRIX }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Export deployment matrix | ||
id: export-deployment-matrix | ||
run: | | ||
delimiter="$(openssl rand -hex 8)" | ||
JSON="$(cat ./deployment-config.json)" | ||
echo "DEPLOYMENT_MATRIX<<${delimiter}" >> "${GITHUB_OUTPUT}" | ||
echo "$JSON" >> "${GITHUB_OUTPUT}" | ||
echo "${delimiter}" >> "${GITHUB_OUTPUT}" | ||
prepare-release-on-servers: | ||
name: "${{ matrix.server.name }}: Prepare release" | ||
runs-on: ubuntu-latest | ||
needs: create-deployment-matrix | ||
strategy: | ||
matrix: | ||
server: ${{ fromJson(needs.create-deployment-matrix.outputs.DEPLOYMENT_MATRIX) }} | ||
steps: | ||
- name: Create directories | ||
uses: appleboy/ssh-action@master | ||
env: | ||
GITHUB_SHA: ${{ github.sha }} | ||
with: | ||
host: ${{ matrix.server.ip }} | ||
username: ${{ matrix.server.username }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ matrix.server.port }} | ||
envs: GITHUB_SHA | ||
script: | | ||
mkdir -p "${{ matrix.server.path }}/releases/${GITHUB_SHA}" | ||
rm -rf ${{ matrix.server.path }}/releases/${GITHUB_SHA}/storage | ||
mkdir -p ${{ matrix.server.path }}/storage/{app,public,framework,logs} | ||
mkdir -p ${{ matrix.server.path }}/storage/framework/{cache,sessions,testing,views} | ||
chmod -R 0777 ${{ matrix.server.path }}/storage | ||
activate-release: | ||
name: "${{ matrix.server.name }}: Activate release" | ||
runs-on: ubuntu-latest | ||
needs: [ create-deployment-matrix, prepare-release-on-servers ] | ||
strategy: | ||
matrix: | ||
server: ${{ fromJson(needs.create-deployment-matrix.outputs.DEPLOYMENT_MATRIX) }} | ||
steps: | ||
- name: Activate release | ||
uses: appleboy/ssh-action@master | ||
env: | ||
GITHUB_SHA: ${{ github.sha }} | ||
RELEASE_PATH: ${{ matrix.server.path }}/releases/${{ github.sha }} | ||
ACTIVE_RELEASE_PATH: ${{ matrix.server.path }}/current | ||
STORAGE_PATH: ${{ matrix.server.path }}/storage | ||
BASE_PATH: ${{ matrix.server.path }} | ||
ENV_SECRET: ${{ secrets.ENV_SECRET }} | ||
with: | ||
host: ${{ matrix.server.ip }} | ||
username: ${{ matrix.server.username }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ matrix.server.port }} | ||
envs: GITHUB_SHA,RELEASE_PATH,ACTIVE_RELEASE_PATH,STORAGE_PATH,BASE_PATH,ENV_SECRET | ||
script: | | ||
echo "$USER" | ||
cd $RELEASE_PATH && git clone git@github.com:antonL95/artistshero-laravel.git ./ | ||
cd $RELEASE_PATH && composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader | ||
cd $RELEASE_PATH && source $BASE_PATH/../.nvm/nvm.sh && npm install --no-progress && npm run build | ||
rm -rf $RELEASE_PATH/storage | ||
ln -s -f $STORAGE_PATH $RELEASE_PATH | ||
ln -s -f ${BASE_PATH}/frankenphp $RELEASE_PATH | ||
/usr/bin/php $RELEASE_PATH/artisan env:decrypt --key=$ENV_SECRET --env=production | ||
mv $RELEASE_PATH/.env.production $RELEASE_PATH/.env | ||
/usr/bin/php $RELEASE_PATH/artisan migrate --force | ||
/usr/bin/php $RELEASE_PATH/artisan route:clear | ||
/usr/bin/php $RELEASE_PATH/artisan event:clear | ||
/usr/bin/php $RELEASE_PATH/artisan view:clear | ||
/usr/bin/php $RELEASE_PATH/artisan config:clear | ||
/usr/bin/php $RELEASE_PATH/artisan route:cache | ||
/usr/bin/php $RELEASE_PATH/artisan event:cache | ||
ln -s -n -f $RELEASE_PATH $ACTIVE_RELEASE_PATH | ||
sudo systemctl restart php8.3-fpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules | ||
dist | ||
.env* | ||
vendor/ | ||
/vendor | ||
public/ | ||
.git | ||
**/.git | ||
package-lock.json | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"printWidth": 120, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.blade.php" | ||
], | ||
"options": { | ||
"parser": "blade" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.