-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add logs to supervisor laravel queue process * update dependabot * composer update * improve deployment * update readme
- Loading branch information
Showing
16 changed files
with
488 additions
and
301 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ public/hot | |
.phpunit.result.cache | ||
.env | ||
environment/prod/deployment/beta | ||
environment/prod/deployment/prod |
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
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 |
---|---|---|
|
@@ -60,9 +60,9 @@ jobs: | |
build-args: DEPLOYMENT_PROJECT_VERSION_ARG=${{ env.DEPLOYMENT_PROJECT_VERSION }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/toby:beta | ||
cache-from: type=gha, ref=ghcr.io/${{ github.repository_owner }}/toby-beta-build-cache | ||
cache-to: type=gha, ref=ghcr.io/${{ github.repository_owner }}/toby-beta-build-cache, mode=max | ||
tags: ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:beta | ||
cache-from: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-beta-build-cache | ||
cache-to: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-beta-build-cache, mode=max | ||
|
||
- name: copy files via ssh | ||
uses: appleboy/[email protected] | ||
|
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 |
---|---|---|
|
@@ -14,10 +14,15 @@ jobs: | |
environment: production | ||
runs-on: ubuntu-22.04 | ||
name: Deploy to production | ||
env: | ||
REPO_NAME: toby | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: set deployment project version | ||
run: echo "DEPLOYMENT_PROJECT_VERSION=$(bash ./environment/prod/deployment/scripts/version.sh --long)" >> $GITHUB_ENV | ||
|
||
- name: set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
|
@@ -28,19 +33,45 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }} | ||
tags: | | ||
type=raw,value=latest | ||
type=raw,value=${{ github.ref_name }} | ||
context: git | ||
|
||
- name: build and push image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./environment/prod/app/Dockerfile | ||
build-args: DEPLOYMENT_PROJECT_VERSION_ARG=${{ env.DEPLOYMENT_PROJECT_VERSION }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/toby:latest | ||
ghcr.io/${{ github.repository_owner }}/toby:${{ github.ref_name }} | ||
cache-from: type=gha, ref=ghcr.io/${{ github.repository_owner }}/toby-prod-build-cache | ||
cache-to: type=gha, ref=ghcr.io/${{ github.repository_owner }}/toby-prod-build-cache, mode=max | ||
ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:latest | ||
ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:${{ github.ref_name }} | ||
cache-from: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-prod-build-cache | ||
cache-to: type=gha, ref=ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}-prod-build-cache, mode=max | ||
|
||
- name: copy files via ssh | ||
uses: appleboy/[email protected] | ||
with: | ||
timeout: 10s | ||
command_timeout: 10m | ||
host: ${{ secrets.VPS_OVH_BF7EC892_HOST }} | ||
port: ${{ secrets.VPS_OVH_BF7EC892_PORT }} | ||
username: ${{ secrets.VPS_OVH_BF7EC892_USERNAME }} | ||
key: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY_PASSPHRASE }} | ||
source: "./environment/prod/deployment/prod/*,./environment/prod/deployment/scripts/*" | ||
target: ${{ secrets.TOBY_VPS_LIVE_APP_PATH }} | ||
rm: true | ||
|
||
- uses: appleboy/[email protected].8 | ||
- uses: appleboy/[email protected].10 | ||
env: | ||
BRANCH_NAME: "main" | ||
with: | ||
|
@@ -53,9 +84,6 @@ jobs: | |
passphrase: ${{ secrets.VPS_OVH_BF7EC892_SSH_PRIVATE_KEY_PASSPHRASE }} | ||
script_stop: true | ||
script: | | ||
cd ${{ secrets.TOBY_VPS_LIVE_APP_PATH }} | ||
git fetch | ||
git checkout --force "${{ env.BRANCH_NAME }}" | ||
git pull | ||
make prod-deploy | ||
docker images --filter dangling=true | grep "ghcr.io/blumilksoftware/toby" | awk '{print $3}'| xargs --no-run-if-empty docker rmi | ||
cd ${{ secrets.TOBY_VPS_LIVE_APP_PATH }}/environment/prod/deployment/prod | ||
make prod-deploy PROD_ENV_KEY=${{ secrets.PROD_ENV_KEY }} | ||
docker images --filter dangling=true | grep "ghcr.io/blumilksoftware/${{ env.REPO_NAME }}" | awk '{print $3}'| xargs --no-run-if-empty docker rmi |
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
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
Oops, something went wrong.