BuildWith Ionos uses Github actions to process the building of projects and deploys the result to a Webspace.
When a new Project is created BuildWith Ionos needs a
buildconfiguration to generate the github actions
workflow file.
A .ionos.yaml in the git repository
will be used if present.
If no configruation is provided in the repository BuildWith Ionos
tries to identify the buildconfiguration.
When this is not possible you can select a build template suitable for
the project.
The following Information should help you to generate a .ionos.yaml for a repository.
The .ionos.yaml has to be in the root
of the git repository.
It defines how to prepare the build environment, build the project and
which directory should be copied to the webspace.
A .ionos.yaml has the following properties:
Name | Type | Required | Description | Example |
---|---|---|---|---|
distFolder | String | true | The folder to copy to the webspace | dist public |
setup | List<SetupStep> | false | The setup steps are uses steps for the workflow to setup the build environment. | see SetupStep |
prepare | PrepareStep | false | The prepare step is run step for the workflow to prepare the environment. | see PrepareStep |
build | BuildStep | false | The build step is a run step for the workflow to build the project. | see BuildStep |
A SetupStep is a
uses steps
for the github workflow that defines a action.
It has the following properties:
Name | Type | Required | Description | Example |
---|---|---|---|---|
name | String | true | The name for the step in the workflow | Setup Node.js 12.x |
action | String | true | The github action | actions/setup-node@v1 |
properties | Map<String, String> | false | The properties will be used as with that are used as INPUT_ for the action. | properties: node-version: 10.13.3 |
A PrepareStep is a
run step
used to prepare the environment e.G. installing the build
dependencies.
It has the following properties:
Name | Type | Required | Description | Example |
---|---|---|---|---|
name | String | true | The name for the step in the workflow | |
command | String | true | The command to setup the environment. Separate commands will be split bei "\n" | Prepare Project build environment |
A BuildStep is a
run step
used to build the project.
It has the following properties:
Name | Type | Required | Description | Example |
---|---|---|---|---|
name | String | true | The name for the step in the workflow | Build node project |
command | String | true | The command to run as build step. Separate commands will be split bei "\n" | yarn build |
environment | Map<String, String> | false | The entries are set es env-variables for the build shell. | environment: SITE_URL: ${{ steps.project.outputs.site-url }} CI: true |
The
Get Project Info Action
will be added to the workflow with id: project.
This action outputs site-url and remote-host that can be
accessed in an environment of the BuildStep via
${{ steps.project.outputs.site-url }}
The github action will then use the output from Get Project Info and
inject it into environment variable.