Skip to content

πŸ’Ž Deploy to PROD #8

πŸ’Ž Deploy to PROD

πŸ’Ž Deploy to PROD #8

Workflow file for this run

name: πŸ’Ž Deploy to PROD
on:
workflow_dispatch:
inputs:
git_ref:
description: Git ref
required: true
default: main
jobs:
build_docker:
uses: yearn/yearn-exporter-api/.github/workflows/build-push.yml@main
with:
git_ref: ${{ github.event.inputs.git_ref }}
deployment:
runs-on: ubuntu-latest
needs: build_docker
steps:
- name: Extract docker tag
id: extract_values
run: |
GIT_REF=${{ github.event.inputs.git_ref }}
DOCKER_TAG=$([[ ${GIT_REF} == 'main' ]] && echo 'latest' || echo ${GIT_REF})
echo "docker_tag=${DOCKER_TAG}" >> $GITHUB_OUTPUT
- name: Deploy to prod
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_KEY }}
port: ${{ secrets.PROD_PORT }}
script: cd yearn-exporter-api && git pull && ./deploy.sh ${{ steps.extract_values.outputs.docker_tag }}