Run database migration
Simple GitHub Actions workflow to run database migration with dbup-cli
- We suggest you to read How to setup and use dbup-cli before using this workflow.
name: Run database migrationon:push:branches:- mainenv:DOTNET_VERSION: 5.0.x # Set the.NET version to usejobs:run-db-migration:runs-on: ubuntu-lateststeps:- name: Check out the later source code from "${{ github.ref }}" branchuses: actions/checkout@v2- name: Setup .NET SDK version ${{ env.DOTNET_VERSION }}uses: actions/setup-dotnet@v1with:dotnet-version: ${{ env.DOTNET_VERSION }}- name: Install dbup-cli as a .NET global toolrun: dotnet tool install --global dbup-cli- name: Apply a new schema versionworking-directory: migration # All configuration file and schema version files are in this 'migration' folder.env:MYSQL_HOSTNAME: ${{ secrets.MYSQL_HOSTNAME }}MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }}MYSQL_USERNAME: ${{ secrets.MYSQL_USERNAME }}MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}run: dbup upgrade
Loading comments...