---
name: schematics-autodeploy_template
title: Creating an auto deploy button for Schematics actions
description: Use the instructions to create a button that opens the Schematics actions create page and pre-populates an action name and the GitHub repository URL that stores your Ansible playbook. You can use the button to create Schematics actions more quickly.
last-updated: 2025-01-17
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/schematics?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Creating an auto deploy button for Schematics actions
{: #auto-deploy-url}

Use the instructions to create a button that opens the Schematics actions create page and pre-populates an action name and the GitHub repository URL that stores your Ansible playbook. You can use the button to create Schematics actions more quickly.
{: shortdesc}

For a sample button, see the `Deploy to IBM Cloud&reg;` button on the [Sample Ansible playbook for IBM Cloud&reg;](https://cloud.ibm.com/docs/schematics?topic=schematics-sample_actiontemplates&format=markdown) page.
{: tip}

## Creating the deployment URL
{: #create-url}

1. Create an Ansible playbook and publish the playbook in a GitHub repository. If you do not have a playbook, you can use one of the [IBM-provided Ansible playbooks](https://github.com/Cloud-Schematics/?q=Ansible&type=&language=&sort=){: external}.
2. Copy the Git repository URL, such as `https://github.com/Cloud-Schematics/ansible-app-deploy`.
3. Use the following syntax to create the URL to automatically pre-populate an action name and the Git repository URL on the Schematics actions create page. If you do not provide the name and Git repository URL, the `Deploy to IBM Cloud&reg;` link defaults to the **Create an action** page without pre-populating an action name or the Git repository URL.

    Syntax

    ```text
    https://cloud.ibm.com/schematics/actions/create?name=<action_name>&repository=<git_repository_url>
    ```
    {: codeblock}

    Example

    ```text
    https://cloud.ibm.com/schematics/actions/create?name=ansible-app-deploy&repository=https://github.com/Cloud-Schematics/ansible-app-deploy
    ```
    {: codeblock}

4. Open your web browser and enter the URL.
5. Verify that the Schematics actions create page opens and that the **Action name** and **Repository URL** are pre-populated.

## Adding the button to a website or page
{: #add_an_image}

You can add an image to your URL to create your Deploy to IBM Cloud button.

### Adding the button in HTML
{: #add-button-html}

To add the button in an HTML page, such as a website, copy the following code into the page where you want to position the button. Replace `<deployment URL>` with the URL for the Schematics action.
{: shortdesc}

```html
<a href="<deployment URL>" target="_blank">
  <img src="https://cloud.ibm.com/media/docs/images/icons/Deploy_to_cloud.svg" alt="Deploy to IBM Cloud button">
</a>
```
{: codeblock}

### Adding the button in Markdown
{: #add-button-markdown}

To add the button into a markdown file, such as in a repositories readme file, use the following syntax. Replace `<deployment URL>` with the URL for the deployment link.

[![Deploy to IBM Cloud button](https://cloud.ibm.com/media/docs/images/icons/Deploy_to_cloud.svg)](<deployment URL>)

## Next steps
{: #sample-actions-nextsteps}

Explore the [Schematics samples templates](https://cloud.ibm.com/docs/schematics?topic=schematics-sample_actiontemplates&format=markdown) to deploy in your IBM Cloud account.
Looking for more code examples? Check out the [samples for IBM Cloud Schematics GitHub repositories](https://github.com/Cloud-Schematics?q=Ansible&type=all&language=&sort=){: external}.