setup github action #6
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
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 |