Skip to content

Commit

Permalink
Agregar CI para github v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ksobrenat32 committed Aug 26, 2024
1 parent bbfb35e commit 966a623
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI
run-name: Publicación de la pagina web
on:
push:

jobs:
build:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Checkout the current branch
uses: actions/checkout@v3

- name: Initialize the ssh-agent
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Create the docker image
run: make init

- name: Build the website
run: make build

- name: Scan the host key
run: mkdir -p ~/.ssh/ && ssh-keyscan -H $DEPLOY_SERVER -p $DEPLOY_PORT >> ~/.ssh/known_hosts
env:
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}

- name: Deploy the website
run: >-
rsync -avx -e "ssh -p $DEPLOY_PORT" --delete --exclude '.ssh' public/ $DEPLOY_USERNAME@$DEPLOY_SERVER:$DEPLOY_PATH
env:
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USERNAME: ${{ secrets.DEPLOY_USERNAME }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
File renamed without changes.

0 comments on commit 966a623

Please sign in to comment.