Skip to content

Commit

Permalink
setup github action
Browse files Browse the repository at this point in the history
  • Loading branch information
zmzlois committed Mar 17, 2024
1 parent 91347cb commit ff7c1d8
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Initial Setup

on:
release:
types: [published]
push:
branches:
- main
workflow_dispatch:

env:
LONDON_HOST: ${{ secrets.LONDON_HOST }}
FRANKFURT_HOST: ${{ secrets.FRANKFURT_HOST }}
SEATTLE_HOST: ${{ secrets.SEATTLE_HOST }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
USERNAME: ${{ secrets.USERNAME }}

jobs:
prepare-all-host:
name: Prepare London Host
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout all directory
uses: appleboy/[email protected]
with:
host: ${{ env.LONDON_HOST }}, ${{ env.FRANKFURT_HOST }}, ${{ env.SEATTLE_HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.SECRET_KEY }}
port: 22
script: |
chmod +x ./shared/preparation.sh
./shared/preparation.sh
timeout: 3000s

install-k3s-london:
needs: prepare-all-host
name: Install K3s on London Host
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install K3s on London Host
uses: appleboy/[email protected]
with:
host: ${{ env.LONDON_HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.SECRET_KEY }}
port: 22
script: |
chmod +x ./hosts/master-london.sh
./hosts/master-london.sh
timeout: 3000s

install-k3s-frankfurt:
needs: install-k3s-london
name: Install K3s on Frankfurt Host
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install K3s on Frankfurt Host
uses: appleboy/[email protected]
with:
host: ${{ env.FRANKFURT_HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.SECRET_KEY }}
port: 22
script: |
chmod +x ./hosts/worker-frankfurt.sh
./hosts/worker-frankfurt.sh
timeout: 3000s

install-k3s-seattle:
needs: install-k3s-london
name: Install K3s on Seattle Host
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install K3s on Seattle Host
uses: appleboy/[email protected]
with:
host: ${{ env.SEATTLE_HOST }}
username: ${{ env.USERNAME }}
key: ${{ env.SECRET_KEY }}
port: 22
script: |
chmod +x ./hosts/worker-seattle.sh
./hosts/worker-seattle.sh
timeout: 3000s

0 comments on commit ff7c1d8

Please sign in to comment.