A deployment is an [immutable](#deployment-immutability) snapshot of your Hydrogen app, running on Oxygen. Every deployment has its own unique preview URL so that you can view, test, or approve changes before merging them and deploying to production. You can also deploy to specific [environments](/docs/storefronts/headless/hydrogen/environments).
## Continuous deployment
Developers typically prefer automated systems that deploy their app whenever they update its code base. These types workflows are broadly known as continuous integration or continuous delivery/deployment (CI/CD) systems.
Hydrogen and Oxygen support [CI/CD with GitHub](/docs/storefronts/headless/hydrogen/deployments/github) out of the box. You can also [create your own CI/CD workflows](/docs/storefronts/headless/hydrogen/deployments/custom-ci-cd) using the Hydrogen CLI.
## Manual deployment
You can create a new deployment from your local development environment with the Hydrogen CLI `deploy` command. The Hydrogen CLI builds, uploads, and deploys your app, then returns the deployment's unique URL.
Consult the Hydrogen CLI reference for the complete list of options for the [`deploy`](/docs/api/shopify-cli/hydrogen/hydrogen-deploy) command.
## Shareable links
Deployments are private by default, which means that you need to be logged in to your store to view them. You can create shareable links that allow anyone to view deployments, even if they’re not logged in.
Be aware of the following when you use shareable links:
- Shareable links are URLs that include a token that bypasses the deployment's login requirement. Be sure to give shareable links only to people you trust.
- Making changes to a shareable link takes up to 30 seconds.
- Oxygen blocks search engines from indexing shared deployments with a `disallow` rule on the deployment's `robots.txt` file. This prevents potential harm to SEO caused by duplicated content.
### Create a shareable link
1. In your Hydrogen storefront, open the deployment details page for the deployment that you want to update.
1. Click **Share**.
1. Select **Anyone with the link**.
1. Click **Copy link** to copy the shareable link to your clipboard.
1. Click **Close**.
### Reset a shareable link
Resetting a shareable link revokes its existing token and creates a new one. The old link will stop working and people will need to use the new shareable link to view the deployment.
1. In your Hydrogen storefront, open the deployment details page for the deployment that you want to update.
1. Click **Share**.
1. Click **Reset link**.
1. Click **Reset** to confirm.
1. Click **Copy link** to copy the new link.
1. Click **Close**.
### Remove a shareable link
Removing a shareable link revokes its existing token, which returns the deployment to its default state, meaning it's accessible only to logged-in staff.
1. In your Hydrogen storefront, open the deployment details page for the deployment to update.
1. Click **Share**.
1. Click **Staff accounts only**.
1. Click **Close**.
## Deployment rollbacks
By default, [environment URLs](/docs/storefronts/headless/hydrogen/environments#environment-urls) point to the environment’s most recent deployment.
If the most recent update contains a bug or other error, you can temporarily roll back to a previous deployment while you work on a fix. Rolling back doesn't redeploy or delete any deployments; it simply changes which deployment the environment URL points to.
> Caution:
> Oxygen deployments are [immutable](#deployment-immutability), which means that their environment variables could be outdated. Always verify that a previous deployment works as expected before rolling back to it.
### Roll back to a previous deployment
Only production and custom environments can be rolled back.
1. On your Hydrogen storefront overview page, click `…` on the environment to roll back.
1. Click **View deployments**.
1. In the list of deployments, click `…` beside the deployment to roll back to.
1. Click **Make this the current deployment**.
1. Click **Make current for {Environment}** to confirm.
The next time that you push an update to its linked branch, the environment will return to the default behavior of pointing to the most recent deployment.
## Redeployments
Redeploying an Oxygen environment creates a new deployment that re-uses the original deployment's [immutable](#deployment-immutability) code, but injects the current set of [environment variables](/docs/storefronts/headless/hydrogen/environments#environment-variables).
Redeployments are available for production and custom environments, but not the preview environment. When you edit an environment variable in the Shopify admin, you'll be prompted with the option to redeploy the relevant environments, but you can redeploy at any time.
### Redeploy an environment
Redeploying an environment redeploys its current deployment only. Older deployments in that environment aren’t redeployed.
1. On the storefront overview page, click the three dots in the upper right of the environment you want to redeploy.
1. Click **Redeploy environment**.
1. Click **Redeploy** to confirm.
## Deployment immutability
Every deployment in Oxygen is immutable: each deployment is a snapshot of your Hydrogen project's codebase at a specific point in time. Typically, that snapshot is an individual Git commit.
Deployments retain all the [environment variables](/docs/storefronts/headless/hydrogen/environments#environment-variables) that they had when they were first deployed. If you update your environment variables, then older deployments won't use the updated values until you [redeploy](#redeployments).
## Deployment retention policy
Oxygen's data retention policy is designed to ensure that your Hydrogen storefront is always available to customers, and that you can always [roll back](#deployment-rollbacks) to a previous deployment in case of error.
Oxygen deployments remain accessible for a minimum of six months. After that time, deployments are deleted, including their bundled worker files, logs, and preview URLs.
Your ten most recent Oxygen deployments per environment always remain accessible, regardless of how old they are.
### Log data retention
Deployments' runtime logging data is available for up to one month. If you need to retain logging data for longer than that, then consider connecting a [log drain](/docs/storefronts/headless/hydrogen/logging).