DevOps
bit project templates provide features to add support for DevOps using GitHub actions.
CI
CI pipeline which is located in .github/workflows/ci.yml ensures that every change that is committed into
develop branch won't break projects build in the following modes:
- Blazor Server
- Blazor WebAssembly
- Blazor Hybrid - Android
- Blazor Hybrid - iOS
- Blazor Hybrid - Windows
- Blazor Hybrid - Mac
The CI pipeline only has one variable called WEB_APP_DEPLOYMENT_TYPE that you can read more about it here.
CD
CD pipeline located in .github/workflows/cd.yml builds and deploys every change committed in the main branch into production.
By default, the CD pipeline produces .aab and .apk for android, .ipa for iOS, .exe for Windows and, .pkg for macOS.
It also creates a zip folder that contains API+WebAssembly projects and an
EF core migrations bundle
to migrate your database. This pipeline also uploads all of the produced artifacts to the GitHub Actions artifacts.
You can manually deploy the artifacts into corresponding locations (App Stores, Virtual Private Servers), or you can write more scripts to automate these processes.
For example, we've created a deploy phase for API+WebAssembly that updates the database using the migrations bundle and optionally deploy artifacts to azure web apps.
The CD pipeline includes the following variables:
env: WEB_APP_DEPLOYMENT_TYPE: 'Spa' API_SERVER_ADDRESS: 'https://todo.bitplatform.dev/api/' # The API backend URL that clients use to connect to the server. APP_SERVICE_NAME: 'app-service-td-test' # Azure Web App name (If you want to deploy your project to the Azure Web App)
And it also includes the following GitHub actions secrets.
It's important to mention that since the GitHub Actions secrets does not support storing files,
to store secret files (such as pfx files), you need to convert the files' content to base64 and store the encoded result value as secret values.
# IdentityCertificate.pfx (See JWT settings section of https://bitplatform.dev/templates/settings) API_IDENTITY_CERTIFICATE_FILE_BASE64 API_IDENTITY_CERTIFICATE_PASSWORD -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- # Database DB_CONNECTION_STRING -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- # Azure App Service (Optional) AZURE_APP_SERVICE_PUBLISH_PROFILE # https://learn.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- # Android ANDROID_RELEASE_KEYSTORE_FILE_BASE64 ANDROID_RELEASE_SIGNING_PASSWORD ANDROID_RELEASE_KEYSTORE_PASSWORD APPLICATION_VERSION APPLICATION_DISPLAY_VERSION -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- # iOS https://www.andreasnesheim.no/setting-up-ci-for-your-net-maui-ios-app-with-github-actions/ APPSTORE_CODE_SIGNING_CERTIFICATE_FILE_BASE64 APPSTORE_CODE_SIGNING_CERTIFICATE_FILE_PASSWORD APPSTORE_API_KEY_ISSUER_ID APPSTORE_API_KEY_ID APPSTORE_API_KEY_PRIVATE_KEY IOS_CODE_SIGN_PROVISION APPLICATION_VERSION APPLICATION_DISPLAY_VERSION -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
We have a plan to automate the deployment of .ipa and .aab files to the Apple Store & Google Play in the near future. So stay tuned!