Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/deploy-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Deploy
# on:
# push:
# branches:
# - main
on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: prod-deploy
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'npm'

- name: Install npm dependencies
run: npm ci

- name: Build assets
run: npm run build

- name: Zip up the application
run: zip -r application.zip . -x "*.git*" -x "*.github*"

- name: Upload Application Artifact
uses: actions/upload-artifact@v4
with:
name: application
path: application.zip

- name: Place SSH Key
run: echo "${{ secrets.SERVER_SSH_KEY }}" > ./id_rsa && chmod 600 ./id_rsa

- name: Transfer Zip to Server
run: |
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
SERVER="${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }}"
scp -i ./id_rsa application.zip $SERVER:/tmp/application.zip
ssh -i ./id_rsa $SERVER "unzip /tmp/application.zip -d /var/www/choremanager/releases/$TIMESTAMP"
ssh -i ./id_rsa $SERVER "ln -sf /var/www/choremanager/releases/$TIMESTAMP /var/www/choremanager/current"
6 changes: 3 additions & 3 deletions .github/workflows/fix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Fix Code Style
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
# on:
# pull_request:
# types: [ opened, synchronize, reopened, ready_for_review ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: QC
run-name: 'QC (PR #${{ github.event.pull_request.number }})'

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_call:
workflow_dispatch:
# on:
# pull_request:
# types: [opened, synchronize, reopened]
# workflow_call:
# workflow_dispatch:

concurrency:
group: qc-${{ github.event.pull_request.number }}
Expand Down
Loading