Update users.csv #1
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: 🚀 Deploy | |
on: | |
push: | |
branches: [main] | |
paths: ['users.csv'] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
- run: | | |
go mod tidy | |
go build | |
- name: Configure SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$SSH_SKEY" > ~/.ssh/staging.key | |
chmod 600 ~/.ssh/staging.key | |
cat >>~/.ssh/config <<END | |
Host deploy | |
HostName $SSH_HOST | |
User $SSH_USER | |
IdentityFile ~/.ssh/staging.key | |
IdentitiesOnly yes | |
StrictHostKeyChecking no | |
Port $SSH_PORT | |
END | |
env: | |
SSH_USER: ${{ secrets.DEV_FORKBOMB_USER }} | |
SSH_SKEY: ${{ secrets.DEV_FORKBOMB_SKEY }} | |
SSH_HOST: ${{ secrets.DEV_FORKBOMB_HOST }} | |
SSH_PORT: ${{ secrets.DEV_FORKBOMB_PORT }} | |
- name: Copy files | |
run: | | |
scp users.csv deploy:plain_auth_service/ | |
scp plain_auth_service deploy:plain_auth_service/ | |
- name: Restart the service | |
run: ssh deploy 'pkill plain_auth_service && ./plain_auth_service/plain_auth_service &' |