You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
625 B
Plaintext
26 lines
625 B
Plaintext
---
|
|
import Layout from '../../layouts/Layout.astro'
|
|
|
|
import { NewDeployForm } from '../../client/NewDeployForm.jsx'
|
|
import { parseDeploy } from '../../forms.ts'
|
|
import { updateConfig } from '../../config'
|
|
|
|
if (Astro.request.method === 'POST') {
|
|
const body = await Astro.request.formData()
|
|
const formData = Object.fromEntries(body.entries())
|
|
|
|
const newDeploy = parseDeploy(formData)
|
|
|
|
updateConfig(async config => {
|
|
config.deploys.push(newDeploy)
|
|
})
|
|
|
|
return Astro.redirect('/deploys')
|
|
}
|
|
---
|
|
|
|
<Layout title="New Deploy | phCD">
|
|
<h1>New Deploy</h1>
|
|
<NewDeployForm client:load />
|
|
</Layout>
|