add deploy reusable
This commit is contained in:
47
.github/workflows/deploy.yaml
vendored
Normal file
47
.github/workflows/deploy.yaml
vendored
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user