Skip to content

Kabyle (Berber) Flag #72

Kabyle (Berber) Flag

Kabyle (Berber) Flag #72

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build Pull Request
on:
pull_request:
branches: ["master"]
jobs:
build_pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
- name: ssh tunnel to mysql database
run: |
mkdir -p ~/.ssh/
ssh-keyscan -H ara.uberspace.de >> ~/.ssh/known_hosts
eval `ssh-agent -s`
ssh-add - <<< "${{secrets.SSH_PRIVATE_KEY}}"
ssh -fN -L 3306:127.0.0.1:3306 [email protected]
- name: Install
run: npm install
- run: printf "${{ secrets.ENV_LOCAL }}" >> .env.local
- name: Build
run: npm run build
- name: zip
run: zip -r build.zip .next
- name: upload
run: |
ssh-keyscan -H ara.uberspace.de >> ~/.ssh/known_hosts
eval `ssh-agent -s`
ssh-add - <<< "${{secrets.SSH_PRIVATE_KEY}}"
ssh [email protected] 'cd html && ./create_deployment.py ${{ github.event.number }}'
scp build.zip [email protected]:~/html/deploy_${{ github.event.number }}/
ssh [email protected] 'rm -rf ~/html/deploy_${{ github.event.number }}/.next'
ssh [email protected] 'unzip -d ~/html/deploy_${{ github.event.number }}/ ~/html/deploy_${{ github.event.number }}/build.zip'
ssh [email protected] 'supervisorctl stop deploy_${{ github.event.number }}'
ssh [email protected] '/home/duostori/html/kill_rouge_workers.py'
ssh [email protected] 'supervisorctl start deploy_${{ github.event.number }}'