This GitHub Action automates the upgrade of a Component in Huawei Cloud Cloud Application Engine (CAE) using the Huawei Cloud CLI (hcloud).
✅ Secure authentication with Access Key (AK) and Secret Key (SK)
✅ Retrieves Environment, Application, and Component IDs dynamically
✅ Extracts auth_name, namespace, and repository URL for deployment
✅ Executes the "upgrade" action for the specified component
✅ Supports multiple Huawei Cloud regions
name: Deploy to Huawei Cloud CAE
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Deploy Component
uses: lemrex/Upgrade-CAE-component@v1.0.0
with:
project_id: ${{ secrets.HUAWEI_PROJECT_ID }}
enterprise_project_id: "optional"
environment_name: "environment name"
app_name: "app name"
component_name: "component name"
version: "1.0.7"
accessKey: ${{ secrets.ACCESSKEY }}
secretKey: ${{ secrets.SECRETKEY }}
region: "af-south-1"| Name | Description | Required |
|---|---|---|
project_id |
Huawei Cloud Project ID. More Info |
✅ Yes |
environment_name |
Name of the environment | ✅ Yes |
app_name |
Name of the application | ✅ Yes |
component_name |
Name of the component | ✅ Yes |
version |
Version to deploy | ✅ Yes |
accessKey |
Huawei Cloud Access Key (AK) | ✅ Yes |
secretKey |
Huawei Cloud Secret Key (SK) | ✅ Yes |
region |
Huawei Cloud region (e.g., af-south-1) |
✅ Yes |
enterprise_project_id |
ID of the Enterprise Project for resource isolation. Default is 0 (for default project). More Info |
❌ No (Defaults to 0) |
✅ Sensitive Inputs Are Secured
- Use GitHub Secrets (
secrets.ACCESSKEY,secrets.SECRETKEY,secrets.PROJECT_ID) instead of storing credentials in the workflow.
✅ Automatic Credential Cleanup
hcloud configure clearremoves stored credentials after deployment.unset INPUT_AK INPUT_SK INPUT_REGIONclears environment variables.history -cprevents sensitive information from being stored in shell history.
✅ Temporary Script Removal
rm -f /home/runner/entrypoint.shensures the script is not accessible after execution.
- A Huawei Cloud account
- Access Key (AK) and Secret Key (SK)
- A CAE environment, application, and component already created
- The Project ID
🔹 Invalid Credentials
- Ensure AK/SK are correct and have CAE permissions.
- Check that you are using the correct region (
af-south-1,ap-southeast-1, etc.).
🔹 Environment, Application, or Component Not Found
- Verify that the names match what is in Huawei Cloud CAE.
- Run
hcloud CAE ListEnvironmentsandhcloud CAE ListApplicationsmanually.
🔹 Permission Issues
- Ensure your IAM user has the correct CAE permissions.
This project is licensed under the MIT License.