digitalvisioncz/meli-deploy-github-action
Deploy site build to Meli static sites hosting or remove from Meli on branch delete with Github Actions
Meli deploy Github Action
This action makes it easier to work with Meli (static website hosting) within GitHub Actions. You can quickly build and deploy new releases or delete branches with their releases.
As Meli is still in beta, this action is only pre-release, and functionality may change in the future. Tested with Meli v1.0.0-beta.22. Any enhancements or feature requests are welcome!
Examples
Deploy release on push: deploy-branch-preview.yml
Deploy release on PR: deploy-pr-preview.yml
Remove branch on branch delete / PR closed: remove-branch.yml
Inputs
action
Required
Action to make. Currently, it can be either release or remove.
meliUrl
Required
Base URL of your Meli server (without trailing slash, ie. https://meli.dvdev.cz
meliSiteId
Required
Site ID of your Meli site
meliSiteToken
Required (for release action)
Site token of your Meli site
In the future, there will be the option to use API tokens for release action. See Meli's issue #216 for more info.
meliApiToken
Required (for remove action)
Meli API token with release_delete, site_branch_delete site.site_releases_list andsite.site_branch_list scope enabled.
meliSiteRelease
Name of release.
Defaults to: YYYY-MM-DD HH:MM:SS | <branchName> | <commit-SHA>
branchName
Name of Meli branch.
Defaults to: <branch> or pr-<number-of-pr>
- In case of branch push,
branchNamewill default to Git branch name as follows:
- in case of branch
main,branchNamewill bemain- in case of branch
feature/update(or any other prefixes likerelease/*),branchNamewill beupdate(it takes only the part after the last slash)- In case of a pull request,
branchNamewill default topr-${pr_number}(for example,pr-6for PR #6)
buildFolder
Folder with files to release. The path is taken from the root of your repository.
Defaults to dist.
Outputs
meliDeployUrl
URL of deployed release.
It wiill be filled only within
releaseaction.
Example usage
- name: Deploy static site preview
uses: digitalvisioncz/meli-deploy-github-action@1.0.0-beta.2
id: meli
with:
action: release
meliUrl: https://meli.dvdev.cz
meliSiteId: ${{ secrets.MELI_SITE_ID }}
meliSiteToken: ${{ secrets.MELI_SITE_TOKEN }}
buildFolder: outMore examples with comments are in the
examplesfolder.