# Generating Github Workflows

In order to simplify and standardize Github workflows, use the Projects feature on the Portal

{% stepper %}
{% step %}

### Connect your GitHub Account

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2F4syrJ4chMJLk0EvnOX6R%2Fimage.png?alt=media&#x26;token=5b09d939-ce12-4467-84d9-a44c6caeec7f" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Choose the Repository  and Branch

If your repository doesn't have a Dockerfile, the Portal will offer help to created one for you:

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2Fj401QNkyFUaTDRfMRmvg%2Fimage.png?alt=media&#x26;token=125f75bf-0d00-43b2-9abb-40c26dd97f46" alt=""><figcaption></figcaption></figure>

If one or more Dockerfiles already exists, you wil be asked to pick the one you want to use and click Continue

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2FArI2k0yRnoAi8BYRk3O3%2Fimage.png?alt=media&#x26;token=9bdb5590-ceca-4f37-9f82-f5633aced9f5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Review the Workflow file and set Ports

The system will generate a GitHub workflow file that will be run every time a new version tag is created in the repository. The Workflow will build a Docker Image for your project following the Dockerfile instructions, publish the resulting  image, and create a docker-compose-secretvm.yaml file properly referencing the newly built image by its hash, and with comments specifying the exact release tag and commit from which the image was built.

**IMPORTANT: make sure to configure the ports correctly so that the docker-compose-secretvm.yaml file is generated correctly**

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2F2KBtjEzoG2OtO8zCTjOV%2Fimage.png?alt=media&#x26;token=44551ef9-66a0-4c87-8dd7-c3ed70e94308" alt=""><figcaption></figcaption></figure>

&#x20;
{% endstep %}

{% step %}

### Create a new Version Tag to start the Worflow&#x20;

Choose a version tag (e.g. v1.0.0) and click "Continue"

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2F9VAB1KVwKcRPmuHsDUMF%2Fimage.png?alt=media&#x26;token=817b134e-3ded-4756-8586-9de33c07840b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Wait for the Workflow to Finish, review results

<figure><img src="https://1849345700-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgF1LuzRcRVxJ2tTkh299%2Fuploads%2FKB3KKlY9ZzydPGGkfqha%2Fimage.png?alt=media&#x26;token=a3fbcbde-2ab1-4346-ae42-dc864a7c083f" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### Use docker-compose-secretvm.yaml

From now on, every time you create a new release of your project, the workflow will be executed, publishing a new Docker Image and updating your docker-compose-secretvm.yaml with the latest version. Make sure to pick docker-compose-secretvm.yaml from your project when creating new SecretVM instances.
{% endstep %}
{% endstepper %}
