This repository is designed to manage all the static portals generated against build files using the APIMatic DocsGen flow. Each portal is contained in its own directory, with separate subdirectories for build files and it's generated content. The repository uses GitHub Actions to automate the process of building and deploying the portals to Cloudflare.
The repository should be structured as follows:
apimatic-catalog
├── Portal1/
│ └── BuildFiles/
├── Portal2/
│ └── BuildFiles/
├── Portal3/
│ └── BuildFiles/
└── .github/
└── workflows/
└── create-and-deploy-portals.yml
The GitHub Action in this repository automates the process of creating and deploying portals based on the defined directory structure. It collects directories that have changed, zips the build files, sends them to APIMatic recieves the portal files and deploys them on Cloudflare Pages.
This action is triggered on a push
to the main
branch.
- The action runs on the LATEST commit. If multiple changes are being added, ensure they are squashed into ONE commit before pushing to the
main
branch. The action activates only for directories that have changes; it cannot be run manually.
- Make changes to any of the Portal directories (e.g.,
Portal1
,Portal2
, orPortal3
). - Add changes to Git:
git add .
- Commit the changes:
git commit -m "Your commit message"
- Push to the main branch:
git push origin main
- Do NOT update cloudflare repository secrets without first being aware of the consequences.
- Warning: Uppercase characters are NOT allowed in your portal directory naming. The action will fail if uppercase letters are used in your directory naming.
- APIMATIC Versioning: Versioned build files are not supported. Only add the build files from the latest version you want to upload into the
PortalName/BuildFiles/
directory. - Ensure that commits include only changes relevant to the portal's build files to avoid unnecessary deployment runs.
This workflow consists of several jobs:
-
Collect Changed Directories:
- Checks out the code and collects directories that have changed.
-
Build and Deploy:
- Zips the build files in the changed directories.
- Sends the zipped files to APIMatic for processing.
- Checks for an existing Cloudflare project and creates it if necessary.
- Deploys the portal to Cloudflare Pages.
-
Update README:
- Truncates the existing README file and appends filtered subdomains.
- Commits and pushes the updated README back to the repository.
The following secrets are used in this deployment repository:
APIMATIC_API_KEY
: API key for authentication with APIMatic.CLOUDFLARE_ACCOUNT_ID
: Cloudflare account ID.CLOUDFLARE_API_TOKEN
: Cloudflare API token with appropriate permissions.GITHUB_TOKEN
: Provided automatically by GitHub Actions.
This action facilitates efficient integration with the development workflow, ensuring that changes to portals are quickly reflected in production.
Here is the list of all the portals that are currently published to cloudflare from this apimatic-catalog
repository:
\
- http://treasure-data-apimatic-catalog.pages.dev
- http://western-union-apimatic-catalog.pages.dev
- http://token-apimatic-catalog.pages.dev
- http://veem-apimatic-catalog.pages.dev
- http://toast-apimatic-catalog.pages.dev
- http://zeta-tech-apimatic-catalog.pages.dev
- http://sumsub-apimatic-catalog.pages.dev
- http://vipps-mobilepay-apimatic-catalog.pages.dev
- http://ubs-apimatic-catalog.pages.dev