More UI fixes #41
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: MVM Unit Tests & Tagged Deploy | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Make .env.test.local | |
run: | | |
touch .env.test.local | |
echo DATABASE_URL="mysql://mvm:[email protected]:3306/mvm?serverVersion=mariadb-10.11.0" >> .env.test.local | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Shutdown Ubuntu MySQL (SUDO) | |
run: sudo service mysql stop | |
- name: Set up MariaDB | |
uses: getong/[email protected] | |
with: | |
mysql database: mvm_test | |
mysql user: mvm | |
mysql password: password | |
- name: Build MVM | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
load: true | |
pull: true | |
tags: dhilsfu/mvm:latest | |
cache-from: type=registry,ref=dhilsfu/mvm:buildcache | |
cache-to: type=registry,ref=dhilsfu/mvm:buildcache,mode=max | |
- name: Run Unit Tests | |
run: | | |
docker run --rm \ | |
-v "${GITHUB_WORKSPACE}/.env.test.local":/var/www/html/.env.test.local \ | |
--network host \ | |
dhilsfu/mvm:latest make test | |
deploy-image: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- unit-tests | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build & Push Symfony Base | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
pull: true | |
tags: dhilsfu/mvm:latest,dhilsfu/mvm:${{github.ref_name}} | |
cache-from: type=registry,ref=dhilsfu/mvm:buildcache | |
cache-to: type=registry,ref=dhilsfu/mvm:buildcache,mode=max | |
- name: Trigger Gitlab Deploy Job | |
run: | | |
curl -X POST \ | |
--fail \ | |
-F token=${{ secrets.GITLAB_CI_TOKEN }} \ | |
-F "ref=main" \ | |
-F "variables[APP_RELEASE_TAG]=${{github.ref_name}}" \ | |
https://git.lib.sfu.ca/api/v4/projects/525/trigger/pipeline |