Merge pull request #25 from zainasir/mysql-docker #1
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: 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 |