diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..7b27f05 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,47 @@ +on: + workflow_call: + inputs: + tag: + required: false + type: string + default: latest + debug: + required: false + type: boolean + default: false + environment: + type: string + required: true + host: + type: string + required: true + +jobs: + deploy: + runs-on: gpu + env: + TAG: ${{ inputs.tag }} + steps: + - name: Checkout + uses: actions/checkout@master + - name: Yandex Cloud Login + uses: yc-actions/yc-cr-login@v2 + with: + yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} + - name: Import Secrets + uses: hashicorp/vault-action@v2 + id: vault + with: + url: https://vault.hublab.ru/ + method: approle + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + secrets: | + hub/data/tach/${{ inputs.environment }}/base * ; + hub/data/tach/${{ inputs.environment }}/${{github.event.repository.name}} * ; + - name: Deploy + env: + DOCKER_HOST: tcp://${{ inputs.host }}:2376 + run: | + docker compose pull + docker compose up -d \ No newline at end of file