Skip to content

fix: fix deploy config #2

fix: fix deploy config

fix: fix deploy config #2

Workflow file for this run

name: Build & Deploy
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.value }}
steps:
- id: matrix
run: |
echo "value=$(curl https://admin.itracers.xyz:8543/internal/servers -H 'Authorization: ${{ secrets.APP_JWT }}')" >> $GITHUB_OUTPUT
- run: |
echo "${{ steps.matrix.outputs.value }}"
build:
needs: [setup]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.*]
value: ${{fromJSON(needs.setup.outputs.matrix)}}
steps:
- run: |
echo "${{ matrix.value.countryIsoCode }}";
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install app dependencies
run: yarn install
- name: Build app
run: yarn build
- name: Build pkg
run: yarn pkg
- name: Deploying
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.AGENT_SSH_KEY }}
- name: Deliver
run: |
scp -oStrictHostKeyChecking=no dist/ovpnrental_agent deploy@${{ matrix.value.host }}:ovpnrental_agent.zip;
scp -oStrictHostKeyChecking=no install.sh deploy@${{ matrix.value.host }}:install.sh;
ssh -oStrictHostKeyChecking=no deploy@${{ matrix.value.host }} <<< $'chmod +x ./install.sh';
ssh -oStrictHostKeyChecking=no deploy@${{ matrix.value.host }} <<< $'./install.sh';