-
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.
feat: add cd for deploy apps to hosting (#14)
* feat: add cd for deploy apps to hosting * feat: adjust redis config
- Loading branch information
1 parent
f4adc2d
commit 5531427
Showing
3 changed files
with
67 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Deploy App | ||
|
||
"on": | ||
push: | ||
branches: | ||
- main | ||
# on: | ||
# pull_request: | ||
# branches: | ||
# - main | ||
|
||
jobs: | ||
tests: | ||
name: Deploy Process | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "8.3" | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv | ||
coverage: none | ||
|
||
- name: Run composer install | ||
run: composer install -n --prefer-dist --no-dev -o | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.x" | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build App | ||
run: npm run build | ||
|
||
- uses: montudor/action-zip@v1 | ||
with: | ||
args: zip -qq -r deploy/app.zip ./ -x ".git/*" | ||
|
||
- uses: SamKirkland/[email protected] | ||
with: | ||
server: ${{ secrets.FTP_SERVER }} | ||
username: ${{ secrets.FTP_USERNAME }} | ||
password: ${{ secrets.FTP_PASSWORD }} | ||
protocol: ${{ vars.PROTOCOL_FTP }} | ||
local-dir: ./deploy/ | ||
log-level: verbose | ||
timeout: 60000 | ||
|
||
- name: executing remote ssh commands using password | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
password: ${{ secrets.SSH_PASSWORD }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
cd /home/${{ secrets.SSH_USERNAME }}/stepcash | ||
unzip -o app.zip -d /home/${{ secrets.SSH_USERNAME }}/stepcash/ | ||
rm -rf app.zip |
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
Empty file.