Skip to content

Commit

Permalink
test CD (env)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljocha committed May 6, 2024
1 parent fa59170 commit 9c4d8cb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 51 deletions.
30 changes: 18 additions & 12 deletions .github/actions/deploy-common/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
name: deploy-common


inputs:
destination:
description: 'Ansible host'
required: true
user:
required: true
SSH_PRIVATE_KEY:
required: true
VAULT_PASSWORD:
required: true
#inputs:
# destination:
# description: 'Ansible host'
# required: true
# user:
# required: true
# SSH_PRIVATE_KEY:
# required: true
# VAULT_PASSWORD:
# required: true

runs:
using: 'composite'
Expand All @@ -21,9 +21,15 @@ runs:
shell: bash
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ inputs.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
cp known_hosts ~/.ssh/known_hosts
ssh ${{ inputs.user }}@${{ inputs.destination }} hostname -f
ssh $USER@$HOSTNAME hostname -f
# run: |
# install -m 600 -D /dev/null ~/.ssh/id_rsa
# echo "${{ inputs.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
# cp known_hosts ~/.ssh/known_hosts
# ssh ${{ inputs.user }}@${{ inputs.destination }} hostname -f

- name: Pick secret.yml
shell: bash
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/ci.yaml

This file was deleted.

23 changes: 18 additions & 5 deletions .github/workflows/deploy-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,33 @@

name: deploy-test

# TODO: run automatically on push to main
on: [ workflow_dispatch ]

jobs:
call-common:
runs-on: ubuntu-latest
strategy:
matrix:
destination:
- test-cz:
env:
HOSTNAME: usegalaxy-test.cerit-sc.cz
USER: debian
# FIXME: rename to _TEST_CZ
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# TODO: other test hosts here

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Call common
uses: ./.github/actions/deploy-common
with:
destination: 'usegalaxy-test.cerit-sc.cz'
user: 'debian'
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}
# with:
# destination: 'usegalaxy-test.cerit-sc.cz'
# user: 'debian'
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}


0 comments on commit 9c4d8cb

Please sign in to comment.