This commit is contained in:
@@ -23,6 +23,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: "1.23" # adapte selon ta version
|
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
|
- name: Applying database migrations
|
||||||
run: |
|
run: |
|
||||||
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "\
|
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "\
|
||||||
@@ -34,13 +41,6 @@ jobs:
|
|||||||
go mod tidy
|
go mod tidy
|
||||||
go build -o ./bin/greenlight-api ./cmd/api
|
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
|
- name: Deploy to server
|
||||||
run: |
|
run: |
|
||||||
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "rm -rf /var/www/greenlight/*"
|
ssh -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }} "rm -rf /var/www/greenlight/*"
|
||||||
|
|||||||
Reference in New Issue
Block a user