|
30 | 30 | GitHubActionsImage.UbuntuLatest, |
31 | 31 | ImportSecrets = new[] { nameof(GithubToken) }, |
32 | 32 | OnPullRequestBranches = new[] { "main", "master", "develop", "development" }, |
33 | | - InvokedTargets = new[] { nameof(Compile) }, |
| 33 | + InvokedTargets = new[] { nameof(Compile), nameof(BuildStorybook) }, |
34 | 34 | FetchDepth = 0, |
35 | 35 | CacheKeyFiles = new string[] {} |
36 | 36 | )] |
37 | 37 | [GitHubActions( |
38 | 38 | "Deploy", |
39 | 39 | GitHubActionsImage.UbuntuLatest, |
40 | | - ImportSecrets = new[] { nameof(GithubToken), "NPM_TOKEN" }, |
| 40 | + ImportSecrets = new[] { nameof(GithubToken) }, |
41 | 41 | OnPushBranches = new[] { "main", "master", "release/*" }, |
42 | 42 | OnPushTags = new[] { "v*" }, |
43 | 43 | InvokedTargets = new[] { nameof(Deploy) }, |
44 | 44 | FetchDepth = 0, |
45 | | - CacheKeyFiles = new string[] {} |
| 45 | + CacheKeyFiles = new string[] {}, |
| 46 | + WritePermissions = new[] { |
| 47 | + GitHubActionsPermissions.IdToken, |
| 48 | + GitHubActionsPermissions.Contents, |
| 49 | + }, |
| 50 | + AutoGenerate = false |
46 | 51 | )] |
47 | 52 | [GitHubActions( |
48 | 53 | "Publish_Site", |
@@ -263,23 +268,26 @@ class Build : NukeBuild |
263 | 268 | .DependsOn(TagRelease) |
264 | 269 | .DependsOn(Release) |
265 | 270 | .Executes(() => { |
266 | | - var npmToken = Environment.GetEnvironmentVariable("NPM_TOKEN"); |
267 | | - var npmrcFile = RootDirectory / ".npmrc"; |
268 | | - npmrcFile.WriteAllText($"//registry.npmjs.org/:_authToken={npmToken}"); |
269 | 271 | var tag = gitRepository.IsOnMainOrMasterBranch() ? "latest" : "next"; |
270 | | - Npm($"publish --access public --tag {tag} --workspaces"); |
| 272 | + Npm($"publish --access public --tag {tag} --workspaces --provenance"); |
271 | 273 | }); |
272 | 274 |
|
273 | 275 | Target PublishSite => _ => _ |
274 | 276 | .DependsOn(CreateDeployBranch) |
275 | | - .DependsOn(Compile) |
| 277 | + .DependsOn(BuildStorybook) |
276 | 278 | .Executes(() => |
277 | 279 | { |
278 | 280 | NpmRun(s => s |
279 | 281 | .SetProcessWorkingDirectory(StencilDirectory) |
280 | | - .SetCommand("build-storybook")); |
| 282 | + .SetCommand("deploy-storybook")); |
| 283 | + }); |
| 284 | + |
| 285 | + Target BuildStorybook => _ => _ |
| 286 | + .DependsOn(Compile) |
| 287 | + .Executes(() => |
| 288 | + { |
281 | 289 | NpmRun(s => s |
282 | 290 | .SetProcessWorkingDirectory(StencilDirectory) |
283 | | - .SetCommand("deploy-storybook")); |
| 291 | + .SetCommand("build-storybook")); |
284 | 292 | }); |
285 | 293 | } |
0 commit comments