diff --git a/.github/actions/docker-ovh-deploy/action.yml b/.github/actions/docker-ovh-deploy/action.yml index 2671898e50..6fa69e9538 100644 --- a/.github/actions/docker-ovh-deploy/action.yml +++ b/.github/actions/docker-ovh-deploy/action.yml @@ -8,13 +8,13 @@ inputs: ssh_host: description: "OVH Container SSH host" required: true - ssh_private_key: - description: "OVH Container SSH private key" + ssh_public_key: + description: "OVH Container SSH public key" required: true - ssh_private_key_name: - description: "OVH Container SSH private key name" + ssh_public_key_name: + description: "OVH Container SSH public key name" required: false - default: "id_rsa_ovh_container" + default: "id_rsa_ovh_container.pub" registry: description: "OVH Container Registry" required: true @@ -38,9 +38,9 @@ runs: - name: Deploy Container shell: bash run: | - echo "${{ inputs.ssh_private_key }}" > ~/.ssh/${{ inputs.ssh_private_key_name }} - sudo chmod 600 ~/.ssh/${{ inputs.ssh_private_key_name }} - ssh -t -t ${{ inputs.ssh_username }}@${{ inputs.ssh_host }} -i ~/.ssh/${{ inputs.ssh_private_key_name }} << EOF + echo "${{ inputs.ssh_public_key }}" > ~/.ssh/${{ inputs.ssh_public_key_name }} + sudo chmod 600 ~/.ssh/${{ inputs.ssh_public_key_name }} + ssh -t -t ${{ inputs.ssh_username }}@${{ inputs.ssh_host }} -i ~/.ssh/${{ inputs.ssh_public_key_name }} << EOF docker login ${{ inputs.registry }} -u ${{ inputs.username }} -p ${{ inputs.password }} docker pull ${{ inputs.registry }}/${{ inputs.image_name }}:${{ inputs.image_tag }} docker stop $(docker ps -aq) diff --git a/.github/workflows/api-ovh.yml b/.github/workflows/api-ovh.yml index 5c167bf6a7..dfce91af51 100644 --- a/.github/workflows/api-ovh.yml +++ b/.github/workflows/api-ovh.yml @@ -38,7 +38,7 @@ jobs: with: ssh_username: ${{ secrets.OVH_SSH_USERNAME }} ssh_host: ${{ secrets.OVH_SSH_HOST }} - ssh_private_key: ${{ secrets.OVH_SSH_PRIVATE_KEY }} + ssh_private_key: ${{ secrets.OVH_SSH_PUBLIC_KEY }} registry: ${{ secrets.OVH_REGISTRY_ENDPOINT }} username: ${{ secrets.OVH_USERNAME }} password: ${{ secrets.OVH_PASSWORD }} diff --git a/api/src/index.js b/api/src/index.js index 973e11f37b..da5bfdda88 100644 --- a/api/src/index.js +++ b/api/src/index.js @@ -158,7 +158,7 @@ const validateCustomHeader = require("./middlewares/validateCustomHeader"); app.get("/", async (req, res) => { const d = new Date(); - res.status(200).send("SNU OVH Deploy v3" + d.toLocaleString()); + res.status(200).send("SNU OVH Deploy v4" + d.toLocaleString()); }); app.get("/testsentry", async (req, res) => {