Skip to content

Commit

Permalink
Merge pull request #25 from PyConColombia/issue-24
Browse files Browse the repository at this point in the history
#24: Configurar despliegue automatico
  • Loading branch information
arendondiosa authored Jul 9, 2023
2 parents 0aa9d68 + 67d3082 commit 77afea7
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Develop CI

on:
pull_request:
branches:
- develop
push:
branches:
- develop

jobs:
deploy:
name: Deploy develop branch
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: develop
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
architecture: "x64"
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install lektor
- name: Show python environment
run: |
python --version
python -m pip list
- name: Install plugins
run: lektor plugins reinstall
- name: Build site
run: lektor build
- name: Lektor deploy
if: github.event_name == 'push'
env:
LEKTOR_DEPLOY_USERNAME: ${{ secrets.LEKTOR_DEPLOY_USERNAME }}
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }}
run: lektor deploy develop
39 changes: 39 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Production CI

on:
push:
branches:
- production

jobs:
deploy:
name: Deploy production branch
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: production
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
architecture: "x64"
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install lektor
- name: Show python environment
run: |
python --version
python -m pip list
- name: Install plugins
run: lektor plugins reinstall
- name: Build site
run: lektor build
- name: Lektor deploy
if: github.event_name == 'push'
env:
LEKTOR_DEPLOY_USERNAME: ${{ secrets.LEKTOR_DEPLOY_USERNAME }}
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.LEKTOR_DEPLOY_PASSWORD }}
run: sh scripts/deploy.sh
2 changes: 2 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lektor deploy www;
lektor deploy production;

0 comments on commit 77afea7

Please sign in to comment.