Kabyle (Berber) Flag #71
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 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 duostori@ara.uberspace.de | |
- 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 duostori@ara.uberspace.de 'cd html && ./create_deployment.py ${{ github.event.number }}' | |
scp build.zip duostori@ara.uberspace.de:~/html/deploy_${{ github.event.number }}/ | |
ssh duostori@ara.uberspace.de 'rm -rf ~/html/deploy_${{ github.event.number }}/.next' | |
ssh duostori@ara.uberspace.de 'unzip -d ~/html/deploy_${{ github.event.number }}/ ~/html/deploy_${{ github.event.number }}/build.zip' | |
ssh duostori@ara.uberspace.de 'supervisorctl stop deploy_${{ github.event.number }}' | |
ssh duostori@ara.uberspace.de '/home/duostori/html/kill_rouge_workers.py' | |
ssh duostori@ara.uberspace.de 'supervisorctl start deploy_${{ github.event.number }}' |