Skip to content

Deploy production

Deploy production #15

name: Deploy production
on:
workflow_call:
workflow_dispatch:
jobs:
build_image:
name: Build image
uses: ./.github/workflows/build-image.yml
secrets: inherit
deploy_production:
name: Deploy production
needs: [ build_image ]
runs-on: ubuntu-latest
steps:
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
cat >>~/.ssh/config <<END
Host staging
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/deploy.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.LIVE_DEPLOY_USER }}
SSH_KEY: ${{ secrets.LIVE_DEPLOY_KEY }}
SSH_HOST: ${{ secrets.LIVE_DEPLOY_HOST }}
- name: Updating the image on the server
run: |
./deploy-service.sh config-service ${{ github.sha }}