0. Hetzner Install Dependencies #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a workflow that installs dependencies | |
name: 0. Hetzner Install Dependencies | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
hetzner_server: | |
description: 'Which server to deploy to? Hetzner_blue or Hetzner_green' | |
required: true | |
default: 'Hetzner_' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
Install-Dependencies: | |
runs-on: ubuntu-latest | |
environment: '${{ github.event.inputs.hetzner_server }}' | |
steps: | |
- name: Configure SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$SSH_KEY" > ~/.ssh/staging.key | |
chmod 600 ~/.ssh/staging.key | |
cat >>~/.ssh/config <<END | |
Host staging | |
HostName $SSH_HOST | |
User $SSH_USER | |
IdentityFile ~/.ssh/staging.key | |
StrictHostKeyChecking no | |
END | |
env: | |
SSH_USER: ${{ vars.SERVER_USER }} | |
SSH_KEY: ${{ secrets.SERVER_SSH_KEY }} | |
SSH_HOST: ${{ vars.SERVER_HOST }} | |
- name: Update apt | |
run: ssh staging 'sudo apt-get -y update' | |
- name: Install nginx | |
run: ssh staging 'sudo apt-get -y install nginx' | |
- name: Install mysql | |
run: ssh staging 'sudo apt-get -y install mysql-server' | |
- name: Install postgres | |
run: ssh staging 'sudo apt-get -y install postgresql' | |
- name: Install git-lfs | |
run: ssh staging 'sudo apt-get -y install git-lfs' | |
- name: Install aws | |
run: ssh staging 'sudo apt-get -y install unzip; curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; unzip awscliv2.zip; sudo ./aws/install;' | |
- name: Install essential build tools for rust | |
run: ssh staging 'sudo apt-get -y install build-essential pkg-config libssl-dev' |