This commit is contained in:
@@ -23,6 +23,13 @@ jobs:
|
||||
with:
|
||||
go-version: "1.23" # adapte selon ta version
|
||||
|
||||
- name: Add host key to known_hosts
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.RUNNER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -p ${{ secrets.SERVER_PORT }} -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Applying database migrations
|
||||
run: |
|
||||
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "\
|
||||
@@ -34,13 +41,6 @@ jobs:
|
||||
go mod tidy
|
||||
go build -o ./bin/greenlight-api ./cmd/api
|
||||
|
||||
- name: Add host key to known_hosts
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.RUNNER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -p ${{ secrets.SERVER_PORT }} -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "rm -rf /var/www/greenlight/*"
|
||||
|
||||
Reference in New Issue
Block a user