Skip to content

Commit

Permalink
test: github actions OVH
Browse files Browse the repository at this point in the history
  • Loading branch information
FlawaCLV committed Nov 24, 2023
1 parent 548f8ca commit dcaebef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
18 changes: 8 additions & 10 deletions .github/actions/docker-ovh-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ inputs:
ssh_host:
description: "OVH Container SSH host"
required: true
ssh_public_key:
description: "OVH Container SSH public key"
ssh_private_key:
description: "OVH Container SSH private key"
required: true
ssh_public_key_path:
description: "OVH Container SSH public key name"
required: false
default: "~/.ssh/id_rsa_ovh_container.pub"
registry:
description: "OVH Container Registry"
required: true
Expand All @@ -35,13 +31,15 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.1
with:
ssh-private-key: ${{ inputs.ssh_private_key }}

- name: Deploy Container
shell: bash
run: |
touch ${{ inputs.ssh_public_key_path }}
echo "${{ inputs.ssh_public_key }}" >> ${{ inputs.ssh_public_key_path }}
chmod 600 ${{ inputs.ssh_public_key_path }}
ssh -t -t ${{ inputs.ssh_username }}@${{ inputs.ssh_host }} -i ${{ inputs.ssh_public_key_path }} << EOF
ssh ${{ inputs.ssh_username }}@${{ inputs.ssh_host }} << 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)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/api-ovh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
ssh_username: ${{ secrets.OVH_SSH_USERNAME }}
ssh_host: ${{ secrets.OVH_SSH_HOST }}
ssh_public_key: ${{ secrets.OVH_SSH_PUBLIC_KEY }}
ssh_private_key: ${{ secrets.OVH_SSH_PRIVATE_KEY }}
registry: ${{ secrets.OVH_REGISTRY_ENDPOINT }}
username: ${{ secrets.OVH_USERNAME }}
password: ${{ secrets.OVH_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 v6" + d.toLocaleString());
res.status(200).send("SNU OVH Deploy v7" + d.toLocaleString());
});

app.get("/testsentry", async (req, res) => {
Expand Down

0 comments on commit dcaebef

Please sign in to comment.