mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
deploy: Add ability to invalidate Google Cloud CDN
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
298092d516
commit
674e81ae87
@@ -249,11 +249,20 @@ func (d *Deployer) Deploy(ctx context.Context) error {
|
||||
jww.FEEDBACK.Println("Success!")
|
||||
}
|
||||
|
||||
if d.invalidateCDN && d.target.CloudFrontDistributionID != "" {
|
||||
jww.FEEDBACK.Println("Invalidating CloudFront CDN...")
|
||||
if err := InvalidateCloudFront(ctx, d.target.CloudFrontDistributionID); err != nil {
|
||||
jww.FEEDBACK.Printf("Failed to invalidate CloudFront CDN: %v\n", err)
|
||||
return err
|
||||
if d.invalidateCDN {
|
||||
if d.target.CloudFrontDistributionID != "" {
|
||||
jww.FEEDBACK.Println("Invalidating CloudFront CDN...")
|
||||
if err := InvalidateCloudFront(ctx, d.target.CloudFrontDistributionID); err != nil {
|
||||
jww.FEEDBACK.Printf("Failed to invalidate CloudFront CDN: %v\n", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
if d.target.GoogleCloudCDNOrigin != "" {
|
||||
jww.FEEDBACK.Println("Invalidating Google Cloud CDN...")
|
||||
if err := InvalidateGoogleCloudCDN(ctx, d.target.GoogleCloudCDNOrigin); err != nil {
|
||||
jww.FEEDBACK.Printf("Failed to invalidate Google Cloud CDN: %v\n", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
jww.FEEDBACK.Println("Success!")
|
||||
}
|
||||
|
Reference in New Issue
Block a user