Use workflow from branch for testing #4082
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | ||
name: Deploy Action | ||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
user_name: | ||
required: false | ||
default: hpi-schul-clud-bot | ||
type: string | ||
user_email: | ||
required: false | ||
default: [email protected] | ||
type: string | ||
secrets: | ||
token: | ||
required: true | ||
DEV_VAULT: | ||
required: true | ||
DEV_KUBE_CONFIG: | ||
required: true | ||
DEV_PROXY_CREDENTIALS: | ||
required: false | ||
BINGO_REPO_TOKEN: | ||
required: true | ||
env: | ||
tennens: "brb default nbc thr" | ||
permissions: | ||
contents: read | ||
jobs: | ||
create_branch_identifier: | ||
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/branch-to-namespace.yml@main | ||
with: | ||
branch: ${{ inputs.branch }} | ||
create_artifacts_repos: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
repos: | ||
- schulcloud-server | ||
- schulcloud-client | ||
- nuxt-client | ||
- superhero-dashboard | ||
- schulcloud-calendar | ||
- antivirus_check_service | ||
- version-aggregator | ||
- dof_app_deploy | ||
- h5p-staticfiles-server | ||
steps: | ||
- run: | | ||
echo "git_ref_name=${{ inputs.branch }}" >> $GITHUB_ENV | ||
echo git_ref_name ${{ inputs.branch }} | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: hpi-schul-cloud/${{ matrix.repos }} | ||
token: ${{ secrets.token }} | ||
path: ${{ matrix.repos }} | ||
fetch-depth: 0 | ||
- working-directory: ${{github.workspace }}/${{ matrix.repos }} | ||
shell: bash | ||
run: | | ||
git checkout ${{ env.git_ref_name }} || true | ||
commit_id=$(git rev-parse HEAD) | ||
mkdir -pv ansible/group_vars/all | ||
ansible_varname=$(echo ${{ matrix.repos }} | tr [a-z] [A-Z] | tr - _ | tr \. _ | tr [:blank:] _ ) | ||
filename=$(echo ${ansible_varname} | tr [A-Z] [a-z] ) | ||
for i in ${{ env.tennens }}; do | ||
mkdir -pv ansible/host_vars/${i}_host | ||
echo "${ansible_varname}_IMAGE_TAG: $commit_id" >> ansible/host_vars/${i}_host/$filename.yml | ||
done | ||
- run: tar -cf ${{ matrix.repos }}.tar ansible | ||
working-directory: ${{github.workspace }}/${{ matrix.repos }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.repos }} | ||
path: ${{github.workspace }}/${{ matrix.repos }}/${{ matrix.repos }}.tar | ||
create_artifacts_workspaces: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- create_branch_identifier | ||
strategy: | ||
matrix: | ||
tennens: [ brb, default, nbc, thr ] | ||
steps: | ||
- shell: bash | ||
run: | | ||
mkdir -pv ansible/host_vars/${{ matrix.tennens }}_host | ||
- shell: bash | ||
working-directory: ${{github.workspace }}/ansible/host_vars/${{ matrix.tennens }}_host | ||
run: | | ||
echo "NAMESPACE: ${{ matrix.tennens }}-${{ needs.create_branch_identifier.outputs.id_branch }}" > cfg_host.yml | ||
echo "DOMAIN: ${{ matrix.tennens }}-${{ needs.create_branch_identifier.outputs.id_branch }}.cd.dbildungscloud.dev" >> cfg_host.yml | ||
- run: tar -cf ${{ matrix.tennens }}.tar ansible | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.tennens }} | ||
path: ${{github.workspace }}/${{ matrix.tennens }}.tar | ||
bingo_add_branch: | ||
needs: | ||
- create_branch_identifier | ||
uses: hpi-schul-cloud/dof_bingo/.github/workflows/add-branch.yml@main | ||
with: | ||
branch: ${{ needs.create_branch_identifier.outputs.id_branch }} | ||
secrets: | ||
bingo_token: ${{ secrets.BINGO_REPO_TOKEN }} | ||
deploy_dbc_dev: | ||
needs: | ||
- create_artifacts_repos | ||
- create_artifacts_workspaces | ||
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy_dev.yml | ||
with: | ||
host_name: default_host | ||
tenannt: dbc | ||
secrets: | ||
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }} | ||
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }} | ||
PROXY_CREDENTIALS: ${{ secrets.DEV_PROXY_CREDENTIALS }} | ||
deploy_nbc_dev: | ||
needs: | ||
- create_artifacts_repos | ||
- create_artifacts_workspaces | ||
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy_dev.yml | ||
with: | ||
host_name: nbc_host | ||
tenannt: nbc | ||
secrets: | ||
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }} | ||
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }} | ||
PROXY_CREDENTIALS: ${{ secrets.DEV_PROXY_CREDENTIALS }} | ||
deploy_brb_dev: | ||
needs: | ||
- create_artifacts_repos | ||
- create_artifacts_workspaces | ||
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy_dev.yml | ||
with: | ||
host_name: brb_host | ||
tenannt: brb | ||
secrets: | ||
ONEPASSWORD_VAULT: ${{ secrets.DEV_VAULT }} | ||
KUBECONFIG: ${{ secrets.DEV_KUBE_CONFIG }} | ||
PROXY_CREDENTIALS: ${{ secrets.DEV_PROXY_CREDENTIALS }} |