|
2 | 2 |
|
3 | 3 | This action deploys a project to Arc XP using your Arc XP credentials. |
4 | 4 |
|
| 5 | +## Description |
| 6 | + |
| 7 | +**NOTE:** This action requires that you have an active Arc XP account. If you do not have an Arc XP account, or you have any questions, please contact your Arc XP representative. |
| 8 | + |
| 9 | +This action deploys a Fusion Bundle to Arc XP using your Arc XP credentials. It will deploy the project to the Arc XP instance that matches the `api-hostname` input. If the project has not been deployed before, it will create an initial deployment. If the project has been deployed before, it will create a new deployment and delete the oldest deployment if the number of deployments exceeds the `minimum-running-versions` input. |
| 10 | + |
| 11 | +## Prerequisites |
| 12 | + |
| 13 | +You must have a Fusion Bundle that has been built and is ready to be deployed. You must also have an Arc XP organization ID, API key, and API hostname. |
| 14 | + |
| 15 | +## Security |
| 16 | + |
| 17 | +This action requires that you have an Arc XP account. It will use your Arc XP API key to authenticate with Arc XP. The API key is stored as a secret in your GitHub repository. The API key is used to authenticate with Arc XP and is not shared with anyone else. |
| 18 | + |
| 19 | +## Usage |
| 20 | + |
| 21 | +```yaml |
| 22 | + - name: Perform the deploy |
| 23 | + if: ${{ success() }} |
| 24 | + uses: arcxp/deploy-action@v1 |
| 25 | + with: |
| 26 | + org-id: your-org-here |
| 27 | + api-key: "${{ secrets.YOUR_DEPLOYER_TOKEN_HERE }}" |
| 28 | + api-hostname: api.sandbox.your-org-here.arcpublishing.com |
| 29 | + bundle-prefix: action-demo-1 |
| 30 | +``` |
| 31 | +
|
5 | 32 | ## Inputs |
6 | 33 |
|
7 | 34 | ### `org-id` |
@@ -33,3 +60,63 @@ The number of seconds to wait between retries. Default `5`. |
33 | 60 | The minimum number of versions to keep in a "deployed" state at any given time. The maximum is 10, the minimum is 1. Default `7`. |
34 | 61 |
|
35 | 62 | ## Example |
| 63 | + |
| 64 | +Here's a complete example from a GitHub Action workflow file. This example first builds and zips the Fusion Bundle, and then uses this custom action to deploy to the "Sandbox" environment in the `arctesting2` instance of Arc XP. |
| 65 | + |
| 66 | +```yaml |
| 67 | +--- |
| 68 | +name: Deploy a Fusion Bundle with Custom Action |
| 69 | +
|
| 70 | +on: |
| 71 | + push: |
| 72 | + # Adjust this list of branches if you want to use this action |
| 73 | + # for PRs and pushes. |
| 74 | + branches: |
| 75 | + - branch-name-here |
| 76 | + # This action lets you run this Action manually. |
| 77 | + workflow_dispatch: |
| 78 | +
|
| 79 | +jobs: |
| 80 | + new-deployer: |
| 81 | + runs-on: ubuntu-latest |
| 82 | +
|
| 83 | + steps: |
| 84 | + - name: Checkout the code |
| 85 | + if: ${{ success() }} |
| 86 | + uses: actions/checkout@v3 |
| 87 | +
|
| 88 | + # This configures NodeJS for our purposes. |
| 89 | + - name: Set up Node |
| 90 | + if: ${{ success() }} |
| 91 | + uses: actions/setup-node@v3 |
| 92 | + with: |
| 93 | + #### IF YOU NEED TO CHANGE YOUR NODE VERSION, JUST CHANGE THIS NUMBER |
| 94 | + node-version: 20 |
| 95 | + cache: npm |
| 96 | +
|
| 97 | + # Installs NodeJS dependencies. |
| 98 | + - name: Install dependencies |
| 99 | + if: ${{ success() }} |
| 100 | + run: | |
| 101 | + npm install |
| 102 | +
|
| 103 | + # Build the code. |
| 104 | + - name: Build the Fusion Bundle |
| 105 | + if: ${{ success() }} |
| 106 | + run: | |
| 107 | + npm run build |
| 108 | + npm run zip |
| 109 | +
|
| 110 | + - name: Perform the deploy |
| 111 | + if: ${{ success() }} |
| 112 | + uses: arcxp/deploy-action@v1 |
| 113 | + with: |
| 114 | + org-id: your-org-here |
| 115 | + api-key: "${{ secrets.SANDBOX_DEPLOYER_TOKEN }}" |
| 116 | + api-hostname: api.sandbox.your-org-here.arcpublishing.com |
| 117 | + bundle-prefix: bundle-prefix-here |
| 118 | +``` |
| 119 | + |
| 120 | +## License |
| 121 | + |
| 122 | +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. |
0 commit comments