feat #233: Create new migrations to utilize EnrollmentState
enum in db
#536
Workflow file for this run
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: Build and Test Laravel Project | |
on: | |
push: | |
branches: ["main", "demo"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
phpunit: | |
runs-on: ubuntu-latest | |
container: | |
image: kirschbaumdevelopment/laravel-test-runner:8.2 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 1 | |
- name: create test sqlite database | |
run: | | |
touch database/database.sqlite | |
- name: create permissions | |
run: | | |
chown -R $(id -u):$(id -g) . | |
- name: Install front-end dependencies | |
run: | | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
nvm install v21.6.2 | |
nvm use v21.6.2 | |
npm install | |
npm run build | |
env: | |
USER: root | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CI: true | |
- name: Install composer dependencies | |
run: | | |
composer update | |
composer install | |
- name: Prepare Laravel Application | |
run: | | |
cp .env.testing .env | |
php artisan migrate:fresh --env=testing | |
- name: Generate Key | |
run: php artisan key:generate --env=testing | |
- name: Run Testsuite | |
env: | |
CANVAS_API_KEY: ${{ secrets.CANVAS_API_KEY }} | |
CI: true | |
run: php artisan test | |
deploy_to_demo: | |
name: Deploy to Demo Instance | |
runs-on: ubuntu-latest | |
needs: [phpunit] | |
if: github.ref == 'refs/heads/demo' && github.event_name == 'push' && github.repository == 'UnlockedLabs/UnlockEdv2' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Deploy | |
env: | |
PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }} | |
HOSTNAME: ${{ secrets.SSH_HOST_DEMO }} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
run: | | |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | |
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} '~/deploy.sh' | |
deploy: | |
name: Deploy to Staging instance | |
runs-on: ubuntu-latest | |
needs: [phpunit] | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && github.repository == 'UnlockedLabs/UnlockEdv2' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & Deploy | |
env: | |
PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }} | |
HOSTNAME: ${{ secrets.SSH_HOST }} | |
USER_NAME: ${{ secrets.USER_NAME }} | |
run: | | |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key | |
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} '~/deploy.sh' |