Skip to content

Start

Start #228

Workflow file for this run

name: Start
on:
workflow_dispatch:
inputs:
vscode:
type: boolean
default: false
mongodb:
type: boolean
default: false
postgresql:
type: boolean
default: false
pgadmin:
type: boolean
default: false
redis:
type: boolean
default: false
redisinsight:
type: boolean
default: false
hoppscotch:
type: boolean
default: false
rabbitmq:
type: boolean
default: false
env:
SERVER_SSH_HOST: ${{ secrets.SERVER_SSH_HOST }}
SERVER_SSH_USER: ${{ secrets.SERVER_SSH_USER }}
SERVER_SSH_PASSWORD: ${{ secrets.SERVER_SSH_PASSWORD }}
SERVER_SSH_PORT: ${{ secrets.SERVER_SSH_PORT }}
DOMAIN: ${{ secrets.DOMAIN }}
ACME_EMAIL: ${{ secrets.ACME_EMAIL }}
jobs:
validation:
name: Validation
runs-on: ubuntu-latest
steps:
- if: ${{ env.SERVER_SSH_HOST == '' || env.SERVER_SSH_USER == '' || env.SERVER_SSH_PASSWORD == '' || env.SERVER_SSH_PORT == '' || env.DOMAIN == '' || env.ACME_EMAIL == '' }}
run: exit 1
dependencies:
name: Dependencies
runs-on: ubuntu-latest
needs:
- validation
strategy:
matrix:
dependency:
- name: Docker
script: ./scripts/start/docker.sh
- name: Git
script: ./scripts/start/git.sh
- name: UFW
script: ./scripts/start/ufw.sh
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ${{ matrix.dependency.script }}
- uses: appleboy/[email protected]
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
script: ${{ steps.script.outputs.content }}
compose:
name: Compose file
runs-on: ubuntu-latest
needs:
- dependencies
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/compose.sh
- uses: appleboy/[email protected]
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
script: ${{ steps.script.outputs.content }}
firewall:
name: Firewall
runs-on: ubuntu-latest
needs:
- dependencies
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/firewall.sh
- uses: appleboy/[email protected]
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
script: ${{ steps.script.outputs.content }}
traefik:
name: Traefik
runs-on: ubuntu-latest
needs:
- compose
- firewall
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/traefik.sh
- uses: appleboy/[email protected]
env:
TRAEFIK_DASHBOARD_USERNAME: ${{ secrets.TRAEFIK_DASHBOARD_USERNAME || 'admin' }}
TRAEFIK_DASHBOARD_PASSWORD: ${{ secrets.TRAEFIK_DASHBOARD_PASSWORD || 'admin' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: TRAEFIK_DASHBOARD_USERNAME,TRAEFIK_DASHBOARD_PASSWORD,DOMAIN,ACME_EMAIL
script: ${{ steps.script.outputs.content }}
vscode:
name: VSCode
runs-on: ubuntu-latest
needs:
- traefik
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/vscode.sh
- uses: appleboy/[email protected]
env:
START_VSCODE: ${{ github.event.inputs.vscode }}
VSCODE_TOKEN: ${{ secrets.VSCODE_TOKEN || 'admin' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_VSCODE,VSCODE_TOKEN
script: ${{ steps.script.outputs.content }}
rabbitmq:
name: RabbitMQ
runs-on: ubuntu-latest
needs:
- traefik
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/rabbitmq.sh
- uses: appleboy/[email protected]
env:
START_RABBITMQ: ${{ github.event.inputs.rabbitmq }}
RABBITMQ_USERNAME: ${{ secrets.RABBITMQ_USERNAME || 'admin' }}
RABBITMQ_PASSWORD: ${{ secrets.RABBITMQ_PASSWORD || 'admin' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_RABBITMQ,RABBITMQ_USERNAME,RABBITMQ_PASSWORD
script: ${{ steps.script.outputs.content }}
pgadmin:
name: pgAdmin
runs-on: ubuntu-latest
needs:
- traefik
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/pgadmin.sh
- uses: appleboy/[email protected]
env:
START_PGADMIN: ${{ github.event.inputs.pgadmin }}
PGADMIN_USERNAME: ${{ secrets.PGADMIN_USERNAME || '[email protected]' }}
PGADMIN_PASSWORD: ${{ secrets.PGADMIN_PASSWORD || 'admin' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_PGADMIN,PGADMIN_USERNAME,PGADMIN_PASSWORD
script: ${{ steps.script.outputs.content }}
hoppscotch:
name: Hoppscotch
runs-on: ubuntu-latest
needs:
- traefik
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/hoppscotch.sh
- uses: appleboy/[email protected]
env:
START_HOPPSCOTCH: ${{ github.event.inputs.hoppscotch }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_HOPPSCOTCH
script: ${{ steps.script.outputs.content }}
mongodb:
name: MongoDB
runs-on: ubuntu-latest
needs:
- compose
- firewall
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/mongodb.sh
- uses: appleboy/[email protected]
env:
START_MONGODB: ${{ github.event.inputs.mongodb }}
MONGODB_USER: ${{ secrets.MONGODB_USER || 'root' }}
MONGODB_PASSWORD: ${{ secrets.MONGODB_PASSWORD || 'root' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_MONGODB,MONGODB_USER,MONGODB_PASSWORD
script: ${{ steps.script.outputs.content }}
postgresql:
name: PostgreSQL
runs-on: ubuntu-latest
needs:
- compose
- firewall
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/postgresql.sh
- uses: appleboy/[email protected]
env:
START_POSTGRESQL: ${{ github.event.inputs.postgresql }}
POSTGRESQL_USER: ${{ secrets.POSTGRESQL_USER || 'admin' }}
POSTGRESQL_PASSWORD: ${{ secrets.POSTGRESQL_PASSWORD || 'admin' }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_POSTGRESQL,POSTGRESQL_USER,POSTGRESQL_PASSWORD
script: ${{ steps.script.outputs.content }}
redis:
name: Redis
runs-on: ubuntu-latest
needs:
- compose
- firewall
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/redis.sh
- uses: appleboy/[email protected]
env:
START_REDIS: ${{ github.event.inputs.redis }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_REDIS
script: ${{ steps.script.outputs.content }}
redisinsight:
name: RedisInsight
runs-on: ubuntu-latest
needs:
- traefik
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/redisinsight.sh
- uses: appleboy/[email protected]
env:
START_REDISINSIGHT: ${{ github.event.inputs.redisinsight }}
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
envs: START_REDISINSIGHT,SERVER_SSH_HOST
script: ${{ steps.script.outputs.content }}
cleaning:
name: Cleaning
runs-on: ubuntu-latest
needs:
- vscode
- mongodb
- postgresql
- pgadmin
- redis
- redisinsight
- hoppscotch
- rabbitmq
steps:
- uses: actions/checkout@v3
- uses: juliangruber/read-file-action@v1
id: script
with:
path: ./scripts/start/cleaning.sh
- uses: appleboy/[email protected]
with:
host: ${{ env.SERVER_SSH_HOST }}
username: ${{ env.SERVER_SSH_USER }}
password: ${{ env.SERVER_SSH_PASSWORD }}
port: ${{ env.SERVER_SSH_PORT }}
script: ${{ steps.script.outputs.content }}