autodeploy

This commit is contained in:
bniwredyc 2023-05-14 13:20:48 +02:00
parent d52d171cbb
commit ccc4637a23
2 changed files with 23 additions and 25 deletions

23
.github/workflows/deply.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Deploy
on:
push:
branches:
- main
jobs:
push_to_target_repository:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v2
- name: Push to dokku
run: |
mkdir ~/.ssh
echo "$HOST_KEY" > ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 0400 ~/.ssh/id_rsa
git remote add dokku dokku@v2.discours.io:discoursio-api
git push dokku HEAD:main

View File

@ -1,25 +0,0 @@
---
stages:
- deploy
variables:
APP_NAME: discoursio-api
SERVER: v2.discours.io
deploy:
image:
name: alpine/git
entrypoint: [""]
stage: deploy
environment:
name: production
url: https://v2.discours.io
only:
- main
script:
- mkdir ~/.ssh
- echo "${HOST_KEY}" > ~/.ssh/known_hosts
- echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
- chmod 0400 ~/.ssh/id_rsa
- git remote add dokku dokku@$SERVER:$APP_NAME
- git push dokku HEAD:main