-
Notifications
You must be signed in to change notification settings - Fork 38
61 lines (53 loc) · 1.48 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "Desplegar pagina"
on:
pull_request:
branches:
- "*"
push:
branches:
- "develop"
- "production"
workflow_dispatch:
permissions:
contents: write
env:
DEPLOY: >-
${{
github.event_name != 'pull_request'
&&
(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/production')
}}
OUTPUT: _html
TZ: America/Bogota
jobs:
build:
name: Construir sitio web lektor
runs-on: ubuntu-latest
steps:
- name: Generate access token
if: always()
id: generate_access_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PYTHON_CO_APP_ID }}
private-key: ${{ secrets.PYTHON_CO_APP_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Lektor
run: |
pipx ensurepath
pipx install Lektor unidecode
- name: Build Lektor site
run: lektor build -O '${{ env.OUTPUT }}'
- name: Deploy Lektor site - ${{ github.head_ref || github.ref_name }}
if: env.DEPLOY == 'true'
env:
LEKTOR_DEPLOY_USERNAME: lektor
LEKTOR_DEPLOY_PASSWORD: ${{ steps.generate_access_token.outputs.token }}
run: |
lektor deploy -O '${{ env.OUTPUT }}' ${{ github.head_ref || github.ref_name }}