-
Notifications
You must be signed in to change notification settings - Fork 107
Publishing a Site
With punch publish
(or punch p
) command, you can publish a site to Amazon S3 or to a remote server using SFTP protocol.
You will need to specify the configurations for the preferred publishing strategy in config.json
.
S3 publishing strategy can be used to serve static site using Amazon S3.
A sample configuration for S3 strategy would look like this:
"publish" : {
"strategy" : "s3",
"options" : {
"bucket" : "bucketname",
"region" : "regionname",
"key" : "key",
"secret" : "secret",
"x-amz-acl": "public-read"
}
}
You have to specify a S3 bucket to upload the site and credentials of a user (recommended to create a new user), who got privileges to write to the bucket.
Apart from the required options (bucket, key, secret), you can also specify any S3 specific options such as x-amz-acl
.
You can use Punch's SFTP publishing plugin to publish your site to any server with SFTP access. Go through plugin's README to learn how to install and use the plugin.
-
Punch will generate the site before publishing. If you don't want to generate the site, set the
generate
option tofalse
inpublish
configuration. -
When a site is published, Punch will store the last published time in a hidden file named
.last_published
in the project's root directory. Next time, when you runpunch publish
it will only upload the files modified after the last published time. If you want to force upload the full site, just delete the.last_published
file. -
With current publishing strategies, removed files aren't deleted from the remote servers. You will need to delete them manually.
If you want to follow a different workflow or use some other mechanism to publish your site, you can define your own publishing strategy. Check the section on Defining a Custom Publishing Strategy to learn how to write one.