Split workflow.
This commit is contained in:
parent
23f2acc8ec
commit
437c45523e
|
@ -18,30 +18,19 @@ jobs:
|
|||
# make -C drf-initiation test
|
||||
# make -C django-initiation test
|
||||
|
||||
build:
|
||||
build_and_publish:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: publish
|
||||
env:
|
||||
deploy_key: ${{secrets.deploy_key}}
|
||||
known_hosts: ${{secrets.known_hosts}}
|
||||
run: |
|
||||
mkdir -p ${HOME}/.ssh
|
||||
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts
|
||||
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_ed25519
|
||||
chmod 600 ${HOME}/.ssh/id_ed25519
|
||||
eval $(ssh-agent)
|
||||
ssh-add
|
||||
rm ${HOME}/.ssh/id_ed25519
|
||||
export deploy_key=""
|
||||
python3 -m pip install --user --upgrade pip
|
||||
python3 -m pip install --user mdtoreveal
|
||||
export PATH="$HOME/.local/bin/:$PATH"
|
||||
make -C python-initiation rsync
|
||||
make -C python-avance rsync
|
||||
make -C drf-initiation rsync
|
||||
make -C django-initiation rsync
|
||||
sudo apt-get install -y cutycapt
|
||||
QT_QPA_PLATFORM=offscreen make -C python-perfs rsync
|
||||
strategy:
|
||||
matrix:
|
||||
directory:
|
||||
- python-initiation
|
||||
- python-avance
|
||||
- drf-initiation
|
||||
- django-initiation
|
||||
- python-perfs
|
||||
secrets:
|
||||
deploy_key: ${{ secrets.deploy_key }}
|
||||
known_hosts: ${{ secrets.known_hosts }}
|
||||
uses: JulienPalard/formations/.github/workflows/deploy.yml@main
|
||||
with:
|
||||
directory: ${{ matrix.directory }}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
directory:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
deploy_key:
|
||||
required: true
|
||||
known_hosts:
|
||||
required: true
|
||||
jobs:
|
||||
build_and_publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- run: |
|
||||
sudo apt-get install -y cutycapt
|
||||
- name: Build and Publish
|
||||
env:
|
||||
deploy_key: ${{secrets.deploy_key}}
|
||||
known_hosts: ${{secrets.known_hosts}}
|
||||
QT_QPA_PLATFORM: offscreen
|
||||
run: |
|
||||
mkdir -p ${HOME}/.ssh
|
||||
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts
|
||||
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_ed25519
|
||||
chmod 600 ${HOME}/.ssh/id_ed25519
|
||||
eval $(ssh-agent)
|
||||
ssh-add
|
||||
rm ${HOME}/.ssh/id_ed25519
|
||||
export deploy_key=""
|
||||
python3 -m pip install --user --upgrade pip
|
||||
python3 -m pip install --user mdtoreveal
|
||||
export PATH="$HOME/.local/bin/:$PATH"
|
||||
make -C ${{ inputs.directory }} rsync
|
Loading…
Reference in New Issue