Update build.yml with test deploy
Some checks failed
Linux arm64 / Build-and-Deploy (push) Failing after 38s
Some checks failed
Linux arm64 / Build-and-Deploy (push) Failing after 38s
This commit is contained in:
@@ -1,21 +1,22 @@
|
|||||||
name: Linux arm64
|
name: Linux arm64
|
||||||
run-name: Build App
|
run-name: Build and Deploy Portfolio
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
Build-and-Deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build
|
- name: Install dependencies and build
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- uses: webfactory/ssh-agent@v0.9.0
|
- name: Set up SSH agent
|
||||||
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
with:
|
with:
|
||||||
ssh-private-key: ${{ secrets.SSH_KEY_PORTFOLIO }}
|
ssh-private-key: ${{ secrets.SSH_KEY_PORTFOLIO }}
|
||||||
|
|
||||||
@@ -24,11 +25,24 @@ jobs:
|
|||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
ssh-keyscan -H git.ale-pri.com >> ~/.ssh/known_hosts
|
ssh-keyscan -H git.ale-pri.com >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- name: Upload build folder to temporary directory on remote server
|
||||||
with:
|
|
||||||
name: Release Build
|
|
||||||
path: ${{ github.workspace }}/build
|
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
run: |
|
run: |
|
||||||
scp -r build ubuntu@git.ale-pri.com:Sites/Portfolio
|
scp -r build ubuntu@git.ale-pri.com:/Poubelle/build
|
||||||
|
|
||||||
|
- name: Deploy to final directory on remote server
|
||||||
|
run: |
|
||||||
|
ssh ubuntu@git.ale-pri.com << 'EOF'
|
||||||
|
BUILD_TMP=/Poubelle/build
|
||||||
|
DEPLOY_DIR=/var/www/portfolio
|
||||||
|
|
||||||
|
sudo mkdir -p $DEPLOY_DIR
|
||||||
|
|
||||||
|
sudo rsync -a --delete $BUILD_TMP/ $DEPLOY_DIR/
|
||||||
|
|
||||||
|
sudo chown -R www-data:www-data $DEPLOY_DIR
|
||||||
|
sudo chmod -R 755 $DEPLOY_DIR
|
||||||
|
|
||||||
|
sudo rm -rf $BUILD_TMP
|
||||||
|
|
||||||
|
sudo nginx -t && sudo systemctl reload nginx
|
||||||
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user