Merge pull request #162 from UniRegensburg/dev #6
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: Deploy Client | |
on: | |
push: | |
branches: | |
- "main" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [15.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install and build | |
run: npm install --force && npm run build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-dir | |
path: build | |
retention-days: 5 | |
DeployClient: | |
name: Deploy Client | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: SSH | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa | |
echo "HIER" | |
ssh-keyscan "${{ secrets.SSH_HOST }}" > ~/.ssh/known_hosts | |
- name: Get Build Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-dir | |
- name: Deploy Client | |
run: | | |
ls | |
scp -r * ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.WORK_DIR_READONLY }} | |
- name: Cleanup | |
run: rm -rf ~/.ssh |