-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (39 loc) · 1.66 KB
/
build-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Build and deploy
on:
push:
branches:
["master"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: './manual'
- name: Add L2TP Network Manager PPA
shell: bash
run: sudo add-apt-repository ppa:nm-l2tp/network-manager-l2tp -y
- name: Install L2TP Network Manager
shell: bash
run: sudo apt install network-manager-l2tp -y
- name: Create UFPE VPN
shell: bash
run: sudo nmcli connection add connection.id CINUFPE con-name CINUFPE type VPN vpn-type l2tp ifname -- connection.autoconnect no ipv4.method auto vpn.data "gateway = ${{ secrets.VPN_GATEWAY }}, ipsec-enabled = yes, mru = 1400, mtu = 1400, password-flags = 0, refuse-chap = yes, refuse-mschap = yes, refuse-pap = yes, require-mppe = yes, user = ${{ secrets.USER }}" vpn.secrets "password=${{ secrets.PASSWORD }}, ipsec-psk = ${{ secrets.PSK }}"
- name: Connect UFPE VPN
shell: bash
run: nmcli c up CINUFPE
- name: Pack changes
shell: bash
run: tar -czvf manual.tar.gz ./manual
- name: Upload changes
shell: bash
run: sshpass -p ${{ secrets.SSH_PASS }} scp -o StrictHostKeyChecking=accept-new ./manual.tar.gz ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_PATH }}
- name: Unpack (deploy) changes
shell: bash
run: sshpass -p ${{ secrets.SSH_PASS }} ssh -o StrictHostKeyChecking=accept-new ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} tar -xzf ${{ secrets.SSH_PATH}}/manual.tar.gz