Skip to content

🎻 Deploy to staging #9

🎻 Deploy to staging

🎻 Deploy to staging #9

name: 🎻 Deploy to staging
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 staging
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_KEY }}
port: ${{ secrets.STAGING_PORT }}
script: cd yearn-exporter-api && git pull && ./deploy.sh ${{ steps.extract_values.outputs.docker_tag }}