SIENTIAPDE-1352: Add deploy workflow and update README with local repository execution instructions.

This commit is contained in:
Bruno Domingues
2025-12-04 12:09:50 -03:00
parent 46df241f7d
commit cdaafd12cc
2 changed files with 80 additions and 2 deletions

52
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Deploy Python Application
on:
pull_request:
types:
- closed
branches:
- main
jobs:
get-version:
name: Determine Next Version
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
version: ${{ steps.version.outputs.next_version }}
steps:
- uses: actions/checkout@v4
- name: Determine next version
id: version
uses: Aignosi/github_workflow_templates/.github/actions/determine-next-version@main
with:
branch_name: ${{ github.event.pull_request.head.ref }}
deploy:
name: Deploy
needs: [get-version]
uses: Aignosi/github_workflow_templates/.github/workflows/reusable-deploy.yml@feature/SIENTIAPDE-1352
with:
version: ${{ needs.get-version.outputs.version }}
project_type: 'python'
image_name: 'sientia-dataops-model-manager'
helm_chart_path: 'sientia-module'
helm_release_name: 'sientia-dataops-model-manager'
helm_namespace: 'sientia'
app_owner: 'Aignosi'
private_repos: 'sientia-dataops-library'
helm_repo_name: 'sientia'
helm_repo_url: 'https://raw.githubusercontent.com/Aignosi/sientia-dataops-helm-repo/refs/heads/main/'
helm_chart_version: '0.6.0'
helm_values_file: './values.yaml'
secrets:
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
REGISTRY_LOGIN_SERVER: ${{ secrets.REGISTRY_LOGIN_SERVER }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
SUSE_RKE2_KUBE_CONFIG: ${{ secrets.SUSE_RKE2_KUBE_CONFIG }}
CI_DEPS_APP_ID: ${{ secrets.CI_DEPS_APP_ID }}
CI_DEPS_PRIVATE_KEY: ${{ secrets.CI_DEPS_PRIVATE_KEY }}
HELM_REPO_USERNAME: ${{ secrets.HELM_REPO_USERNAME }}
HELM_REPO_PASSWORD: ${{ secrets.HELM_REPO_PASSWORD }}

View File

@@ -1232,8 +1232,8 @@ Create a `.secrets` file in the project root to store tokens and credentials:
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
SONAR_TOKEN=sqp_xxxxxxxxxxxxxxxxxxxx SONAR_TOKEN=sqp_xxxxxxxxxxxxxxxxxxxx
SONAR_HOST_URL=https://sonarqube.example.com SONAR_HOST_URL=https://sonarqube.example.com
APP_ID=123456 CI_DEPS_APP_ID=123456
APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----" CI_DEPS_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
``` ```
> ⚠️ **Important**: The `.secrets` file is already in `.gitignore`. Never commit this file! > ⚠️ **Important**: The `.secrets` file is already in `.gitignore`. Never commit this file!
@@ -1274,6 +1274,32 @@ act pull_request -j quality-gate \
--eventpath .event.json --eventpath .event.json
``` ```
#### Run Deploy Workflow with Local Repository
If you have workflows that reference external repositories (e.g., reusable workflows), you can map them locally:
```bash
act pull_request \
-e .event.json \
--secret-file .secrets \
-W .github/workflows/deploy.yml \
--local-repository Aignosi/github_workflow_templates=/path/to/local/github_workflow_templates \
--container-daemon-socket /var/run/docker.sock \
--container-options "--user $(id -u):$(id -g)"
```
#### Docker Socket Permissions
If you encounter permission issues with Docker socket:
```bash
# Grant temporary access to Docker socket
sudo chmod 666 /var/run/docker.sock
# Fix file ownership after running act (if needed)
sudo chown -R $USER:$USER /path/to/project
```
### Command Reference ### Command Reference
#### Command Parameters #### Command Parameters