Skip to content

Merge pull request #25 from zainasir/mysql-docker #1

Merge pull request #25 from zainasir/mysql-docker

Merge pull request #25 from zainasir/mysql-docker #1

Workflow file for this run

name: Update Database Image
on:
push:
paths:
- 'data/**'
jobs:
update-database-image:
runs-on: ubuntu-latest
if: github.repository == 'cbioportal/cbioportal-test'
env:
DOCKER_REPO: 'cbioportal/cbioportal-dev'
DOCKER_TAG: 'database'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to DockerHub
if: env.CHANGES_DETECTED == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Update database dump
run: |
cd $GITHUB_WORKSPACE
sh ./scripts/docker-compose.sh --portal_type=web-and-data --docker_args='-d'
sh ./utils/check-connection.sh --url=localhost:8080 --interval=5 --max_retries=50
sh ./scripts/import-data.sh --seed=./data/seed.sql.gz --schema=./data/cgds.sql --studies=./data/studies
sh ./scripts/dump-data.sh --url=localhost:8080 --out=database_dump.sql
- name: Push new docker image
run: |
cd $GITHUB_WORKSPACE
docker build -t $DOCKER_REPO:$DOCKER_TAG --build-arg DUMP_PATH=database_dump.sql -f docker/cbioportal-database.Dockerfile .
docker image push $DOCKER_REPO:$DOCKER_TAG