Update main.yml #39
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
# main.yaml | ||
name: Build, Test, and Update Data | ||
on: | ||
push: | ||
branches: ['main'] | ||
jobs: | ||
test_and_update_data: | ||
name: Run Jest Tests and Update Data | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Run Jest Tests | ||
run: | | ||
docker-compose -f docker-compose.dependencies.yaml -f docker-compose.app.yaml run --rm app npm test | ||
- name: Generate Data Dump | ||
run: | | ||
docker-compose -f docker-compose.dependencies.yaml -f docker-compose.app.yaml run --rm app generate_data_dump.sh | ||
- name: Import Data into Clever Cloud Database | ||
run: | | ||
mysql -h$CLEVER_CLOUD_DB_HOST -u$CLEVER_CLOUD_DB_USER -p$CLEVER_CLOUD_DB_PASSWORD $CLEVER_CLOUD_DB_NAME < data_dump.sql | ||
env: | ||
CLEVER_CLOUD_DB_HOST: ${{ secrets.CLEVER_CLOUD_DB_HOST }} | ||
CLEVER_CLOUD_DB_USER: ${{ secrets.CLEVER_CLOUD_DB_USER }} | ||
CLEVER_CLOUD_DB_PASSWORD: ${{ secrets.CLEVER_CLOUD_DB_PASSWORD }} | ||
CLEVER_CLOUD_DB_NAME: ${{ secrets.CLEVER_CLOUD_DB_NAME }} | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
needs: test_and_update_data | ||
steps: | ||
# ... (existing steps remain unchanged) |