Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
By using GitHub Actions for Microsoft Power Platform, you can build GitHub workflows that deploy Power Pages sites. Use them when your team keeps the site in a GitHub repository and wants reviewed, repeatable deployments to test and production.
This article covers the Power Pages-specific actions and patterns. For every action and parameter, see Available GitHub Actions for Microsoft Power Platform.
Prerequisites
- A GitHub repository that contains the site content. For details, see Set up source control and branching for Power Pages.
- A Microsoft Entra app registration added as an application user, with the required security roles, in each target environment.
- Credentials for the app registration stored in GitHub:
- Federated credentials: Configure OpenID Connect (OIDC) so that the workflow authenticates without a client secret. For steps, see Tutorial: Use OIDC/FIC authentication with GitHub Actions for Microsoft Power Platform.
- Client secret: Store the client secret as a GitHub secret, and reference it from the workflow. For details, see Configure credentials to use with GitHub Actions.
Workflow overview
A typical workflow for a Power Pages site:
- Runs when a pull request merges into the main branch, or on demand.
- Installs Power Platform CLI on the runner with the
actions-installaction. - Deploys the site to the test environment.
- Waits for approval, and then deploys the same content to production.
Use GitHub environments for test and production. Store the environment URL and credentials for each target in its environment, and add required reviewers to the production environment so that a person approves each production deployment.
Deploy a site with portal tasks
The upload-paportal action uploads Power Pages website content to a target environment. Use it to deploy standard data model sites. It accepts these Power Pages-specific parameters:
| Parameter | Description |
|---|---|
upload-path |
Path where the website content is stored. |
deployment-profile |
Upload site data with environment details defined in the deployment-profiles/[profile-name].deployment.yaml file. |
model-version |
Whether the site data uses the standard (1) or enhanced (2) data model. The default value is 1. |
The following job deploys a standard data model site to the test environment with a client secret:
jobs:
deploy-test:
runs-on: windows-latest
environment: test
steps:
- uses: actions/checkout@v4
- name: Install Power Platform Tools
uses: microsoft/powerplatform-actions/actions-install@v1
- name: Upload Power Pages site
uses: microsoft/powerplatform-actions/upload-paportal@v1
with:
environment-url: ${{ vars.ENVIRONMENT_URL }}
app-id: ${{ vars.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ vars.TENANT_ID }}
upload-path: site
deployment-profile: test
model-version: 1
Add a similar deploy-production job that uses the production environment, the prod deployment profile, and needs: deploy-test.
Because the content comes from your repository rather than from the target environment, the upload is a full upload. For details, see Understand delta and full uploads.
Deploy enhanced data model and SPA code sites with solutions
For enhanced data model and SPA code sites, promote the site as a solution:
- Add the site and its dependencies to a solution. For details, see Use solutions with Power Pages.
- Use the
export-solutionaction to export the solution from the primary development environment as managed. Setmanagedtotrue. - Use the
import-solutionaction to import the same solution file into each target environment. - After the first deployment to a target environment, reactivate the site.
You can also store the unpacked solution in the repository with unpack-solution and build it with pack-solution, and run check-solution as a quality gate. For SPA code sites, see CI/CD for single-page applications with developer tools.