diff --git a/workflows/deploy-production.yml b/workflows/deploy-production.yml new file mode 100644 index 000000000000..75d6d486ab67 --- /dev/null +++ b/workflows/deploy-production.yml @@ -0,0 +1,32 @@ +name: Deploy Open edX Production + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy to production LMS + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.OPENEDX_PROD_HOST }} + username: ${{ secrets.OPENEDX_PROD_USER }} + key: ${{ secrets.OPENEDX_PROD_SSH_KEY }} + script: | + set -e + cd /opt/performu-openedx + git fetch origin + git checkout main + git pull origin main + tutor config save + tutor images build openedx + tutor local restart + tutor local do init + \ No newline at end of file diff --git a/workflows/deploy-staging.yml b/workflows/deploy-staging.yml new file mode 100644 index 000000000000..df15b6486294 --- /dev/null +++ b/workflows/deploy-staging.yml @@ -0,0 +1,32 @@ +name: Deploy Open edX Staging + +on: + push: + branches: [dev] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy to staging LMS + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.OPENEDX_STAGING_HOST }} + username: ${{ secrets.OPENEDX_STAGING_USER }} + key: ${{ secrets.OPENEDX_STAGING_SSH_KEY }} + script: | + set -e + cd /opt/performu-openedx + git fetch origin + git checkout dev + git pull origin dev + tutor config save + tutor images build openedx + tutor local restart + tutor local do init + \ No newline at end of file