Skip to content

mdr223 deploys A2rchi #25

mdr223 deploys A2rchi

mdr223 deploys A2rchi #25

Workflow file for this run

name: Deploy A2rchi
run-name: ${{ github.actor }} deploys A2rchi
on: [push]
jobs:
deploy-dev-system:
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
# boilerplate message and pull repository to CI runner
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- uses: actions/checkout@v3
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
# setup SSH
- name: Setup SSH
run: |
mkdir -p /home/runner/.ssh/
echo "${{ secrets.SSH_PRIVATE_KEY_MDRUSSO }}" > /home/runner/.ssh/id_rsa_submit
chmod 600 /home/runner/.ssh/id_rsa_submit
echo "${{ secrets.SSH_SUBMIT_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
cp ${{ github.workspace}}/deploy/ssh_config /home/runner/.ssh/config
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/id_rsa_submit
# test ssh
- name: Test SSH
run: |
ssh submit-gpu 'bash -s' < ${{ github.workspace }}/deploy/test.sh
# create secrets file for docker-compose
- name: Create Secrets file
run: |
touch ${{ github.workspace }}/deploy/cleo_url.txt
echo "${{ secrets.DEV_CLEO_URL }}" >> ${{ github.workspace }}/deploy/cleo_url.txt
chmod 400 ${{ github.workspace }}/deploy/cleo_url.txt
touch ${{ github.workspace }}/deploy/cleo_user.txt
echo "${{ secrets.DEV_CLEO_USER }}" >> ${{ github.workspace }}/deploy/cleo_user.txt
chmod 400 ${{ github.workspace }}/deploy/cleo_user.txt
touch ${{ github.workspace }}/deploy/cleo_pw.txt
echo "${{ secrets.DEV_CLEO_PW }}" >> ${{ github.workspace }}/deploy/cleo_pw.txt
chmod 400 ${{ github.workspace }}/deploy/cleo_pw.txt
touch ${{ github.workspace }}/deploy/cleo_project.txt
echo "${{ secrets.DEV_CLEO_PROJECT }}" >> ${{ github.workspace }}/deploy/cleo_project.txt
chmod 400 ${{ github.workspace }}/deploy/cleo_project.txt
# copy repository to machine
- name: Copy Repository
run: |
rsync -e ssh -r ${{ github.workspace}} --exclude .git/ --delete submit-gpu:~/
# run deploy script
- name: Run Deploy Script
run: |
ssh submit-gpu 'bash -s' < ${{ github.workspace }}/deploy/dev-install.sh
# TODO: clean up secret files
# print job status
- run: echo "🍏 This job's status is ${{ job.status }}."