test branch #2
Workflow file for this run
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: "Continuous Deployment" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [preprod-cd] | |
concurrency: ci-${{ github.ref }} | |
env: | |
ECLIPSE_SSH_HOST: monitor.eclipse.mes-aides.incubateur.net | |
ECLIPSE_SSH_USER: debian | |
jobs: | |
install_python_requirements: | |
name: Install Python requirements | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
id: python-dependencies | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-dependencies-${{ hashFiles('**/requirements.txt') }} | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
lint_ansible_files: | |
name: Lint ansible files | |
runs-on: ubuntu-20.04 | |
needs: [install_python_requirements] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
- name: Cache Python dependencies | |
uses: actions/cache@v3 | |
id: python-dependencies | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-dependencies-${{ hashFiles('**/requirements.txt') }} | |
- name: Check installed package | |
run: pip freeze | |
- name: Run ansible lint | |
run: ansible-lint --offline | |
deploy_eclipse_preproduction: | |
name: Preproduction continuous deployment Eclipse | |
runs-on: ubuntu-20.04 | |
needs: [install_python_requirements, lint_ansible_files] | |
if: github.ref == 'refs/heads/preprod-cd' | |
steps: | |
- name: Eclipse Deployment | |
shell: bash | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "${{ secrets.ECLIPSE_PRIVATE_KEY }}" > ~/.ssh/eclipse | |
chmod 600 ~/.ssh/eclipse | |
ssh -o StrictHostKeyChecking=no ${{ env.ECLIPSE_SSH_USER }}@${{ env.ECLIPSE_SSH_HOST }} -i ~/.ssh/eclipse |