Skip to content

Merge pull request #185 from serlo/register-moodle #103

Merge pull request #185 from serlo/register-moodle

Merge pull request #185 from serlo/register-moodle #103

Workflow file for this run

name: Deploy to Uberspace
on:
push:
branches:
- staging
- development
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set environment variables for development
if: ${{ github.ref_name == 'development' }}
run: |
echo "REMOTE_HOST=${{ secrets.REMOTE_HOST_DEV }}" >> $GITHUB_ENV
echo "REMOTE_USER=${{ secrets.REMOTE_USER_DEV }}" >> $GITHUB_ENV
echo "DOMAIN=https://editor.serlo.dev/" >> $GITHUB_ENV
- name: Set environment variables for staging
if: ${{ github.ref_name == 'staging' }}
run: |
echo "REMOTE_HOST=${{ secrets.REMOTE_HOST_STAGING }}" >> $GITHUB_ENV
echo "REMOTE_USER=${{ secrets.REMOTE_USER_STAGING }}" >> $GITHUB_ENV
echo "DOMAIN=https://editor.serlo-staging.dev/" >> $GITHUB_ENV
- name: Deploy to Server
uses: appleboy/[email protected]
with:
host: ${{ env.REMOTE_HOST }}
username: ${{ env.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/${{ env.REMOTE_USER }}/serlo-editor-as-lti-tool/
git checkout --force ${{ github.ref_name }}
git pull
yarn
yarn build
s3cmd get s3://edtr-env/${{ env.REMOTE_USER }}/.env . --force
supervisorctl restart serlo-app
- name: Test deployment successful
run: sleep 5 && curl ${{ env.DOMAIN }} | grep NO_LTIK_OR_IDTOKEN_FOUND