-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (39 loc) · 1.24 KB
/
_deploy.yml
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
41
42
43
44
name: "Deploy to OVHcloud"
on:
workflow_call:
inputs:
subdomain:
required: true
type: string
environment:
description: “Name of GitHub environment"
required: true
type: string
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: ghcr.io/mlcdf/www:latest
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
environment:
name: ${{inputs.environment}}
url: https://${{inputs.subdomain}}.mlcdf.fr
steps:
- uses: actions/checkout@v2
- name: Build
env:
SITEURL: https://${{inputs.subdomain}}.mlcdf.fr
run: |
echo "Building ${SITEURL}"
pipenv run publish
- name: Deploy
env:
SUBDOMAIN: ${{inputs.subdomain}}
OVH_HOSTING_DOMAIN: ${{ secrets.OVH_HOSTING_DOMAIN }}
OVH_HOSTING_USER: ${{ secrets.OVH_HOSTING_USER }}
OVH_HOSTING_PASSWORD: ${{ secrets.OVH_HOSTING_PASSWORD }}
run: |
echo "Deploying"
sshpass -p "$OVH_HOSTING_PASSWORD" rsync -av -e "ssh -o StrictHostKeyChecking=no" output/ $OVH_HOSTING_USER@$OVH_HOSTING_DOMAIN:/home/$OVH_HOSTING_USER/$SUBDOMAIN