Skip to content

lemrex/Upgrade-CAE-component

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Huawei Cloud CAE Component Upgrade

GitHub Marketplace
This GitHub Action automates the upgrade of a Component in Huawei Cloud Cloud Application Engine (CAE) using the Huawei Cloud CLI (hcloud).

Features

✅ 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


Usage

1. Create a Workflow (.github/workflows/deploy.yml)

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"

Inputs

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)

Security Considerations

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 clear removes stored credentials after deployment.
  • unset INPUT_AK INPUT_SK INPUT_REGION clears environment variables.
  • history -c prevents sensitive information from being stored in shell history.

Temporary Script Removal

  • rm -f /home/runner/entrypoint.sh ensures the script is not accessible after execution.

Prerequisites

  • A Huawei Cloud account
  • Access Key (AK) and Secret Key (SK)
  • A CAE environment, application, and component already created
  • The Project ID

Troubleshooting

🔹 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 ListEnvironments and hcloud CAE ListApplications manually.

🔹 Permission Issues

  • Ensure your IAM user has the correct CAE permissions.

REFERENCE


License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors