Nova Deploy Workflow #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nova Deploy Workflow | |
on: workflow_dispatch | |
env: | |
DEPLOY_ENV: nova | |
jobs: | |
set_env_vars: | |
name: Set Environment Variables | |
runs-on: ubuntu-latest | |
outputs: | |
version_tag: ${{ steps.set_version_tag.outputs.version_tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up the version tag for docker images | |
id: set_version_tag | |
run: | | |
COMMIT_HASH=$(git rev-parse --short HEAD) | |
echo "VERSION_TAG=$COMMIT_HASH" >> $GITHUB_OUTPUT | |
use-reusable-workflow: | |
strategy: | |
matrix: | |
directory: [api, client] | |
name: Build Images | |
needs: set_env_vars | |
uses: ./.github/workflows/build-images.reusable.yaml | |
with: | |
directory: ${{ matrix.directory }} | |
image_tags: | | |
iotaledger/explorer-${{ matrix.directory }}:${{ needs.set_env_vars.outputs.version_tag }} | |
secrets: inherit | |
deploy_to_server: | |
name: Deploy Production to Server | |
needs: [set_env_vars, use-reusable-workflow] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.UPDATER_SSH_PRIVATE_KEY }} | |
- name: Deploy to Server | |
run: | | |
ssh -o StrictHostKeyChecking=no updater@${{ secrets.EXPLORER_NOVA_GATEWAY }} "${{ env.DEPLOY_ENV }} ${{ needs.set_env_vars.outputs.version_tag }}" |