If you omit the environment argument, then the deployment will be applied to the production environment.
The CLI will automatically detect your property’s framework, create an optimized production build, and upload it to Edgio. This takes about a minute for most applications.
Once the deployment is complete, the CLI will output the URL for your site. Your property’s name is automatically derived from the name field in package.json. This can be overridden by using --property option when running edgio deploy.
Deployments are versioned. Each deployment is assigned a unique version number. This allows you to quickly roll back to a previous version when a breaking change is introduced into an environment.
To roll back to a previous version
Load the Deployments page.
From the Edgio Console, select the desired private or team space.
Select the desired property.
From the left-hand pane, select the desired environment from under the Environments section.
From the left-hand pane, select Deployments.
Find the deployment that should be applied to this environment, click its icon, and then click Rollback to this version.
When prompted, click Promote to production to confirm that a previous deployment will be applied to this environment.
Each time you deploy your site to Edgio a deployment is created and given a unique and permanent URL based on the team name, site name, branch name in source control, and an incrementing deployment number. If you use Git, the branch name is set by the default. If not, you can specify the --branch option when running edgio deploy.
Having each deployment be simultaneously and permanently accessible makes it easy to preview other developers’ work before merging a pull request and enables you to “go back in time” to find where a bug or change in behavior originated. We recommend configuring your CI environment to deploy every push to Edgio.
You need to configure the following items in order to get a GitHub action set up.
Create a deploy token (see Deploying from CI). Copy the value of that token for use in the next step.
Save the deploy token inside GitHub (more info). Go to your GitHub project > Settings > Secrets > New repository secret. Save the item as EDGIO_DEPLOY_TOKEN.
Inside your development project, create a top level folder titled .github. Inside that create a workflows folder. From there create a edgio.yml file and use the example below for its content.
This is an example GitHub action that will deploy your site to Edgio.
For this action to work
By default, new Edgio sites are created with a default environment. The action below will create a new build for every push on the default environment.
To leverage the GitHub release workflow part of the action below, you need to create an environmentproduction.
You need to have created a deploy key for your site (see above) and added it as a secret in your repo called “edgio_deploy_token”. Read more on accessing environment variables which might be essential for your app during the build time and for server-side requests (including SSG/SSR).
Depending on your use of NPM or YARN, adjust the “Install packages” step
Read the comments at the top to understand how this action is configured.
1# Add this file to your project at .github/workflows/edgio.yml
2#
3# This GitHub action deploys your site on Edgio.
4#
5# The site is deployed each time commits are pushed. The environment to which the changes are deployed
6# is based on the following rules:
7#
8# 1.) When pushing to master or main, changes will be deployed to the "default" environment. This environment exists
9# by default. Additional environments must be created at https://edgio.app.
10#
11# 2.) When pushing to any other branch, changes are deployed to a staging environment when a pull request is opened.
12# A unique URL is created based on the branch and deployment number. This environment does not exist by default,
13# you must create it using https://edgio.app.
14#
15# 3.) When you publish a release in GitHub, the associated tag will be deployed to the production
16# environment. You can push to production by creating a GitHub release, or by using the "Promote to Environment"
17# menu when viewing a deployment in https://edgio.app. This environment does not exist by default,
18# you must create it using https://edgio.app.
19#
20# ** In order for this action to deploy your site, you must create a deploy token from the site settings page
21# ** In order for this action to deploy your site, you must create a `deploy` command in your package.json scripts (an example is at https://github.com/layer0-docs/layer0-docs/blob/master/package.json#L11).
22# ** Additionally, you will need to generate a deploy token from your site settings in https://edgio.app and configure it as a secret called "EDGIO_DEPLOY_TOKEN" in your repo on GitHub.
23#
24# ** Depending on your use of NPM or YARN, adjust the "Install packages" step
25
26name: Deploy branch to Edgio
27
28on:
29push:
30branches:[master, main]
31pull_request:
32release:
33types:[published]
34
35jobs:
36deploy-to-edgio:
37name: Deploy to Edgio
38# cancels the deployment for the automatic merge push created when tagging a release