Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
MINOR: Fix deploy documentation (#2131)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Stichbury <[email protected]>
  • Loading branch information
nzjony authored Mar 2, 2021
1 parent d974007 commit af3cc56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deploy_to_npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
# debug: lerna publish expects clean workspace
./scripts/git-check-clean-workspace.sh
shell: bash
env:
HEAD_BRANCH: ${{ github.head_ref }}

- name: Setup Node
if: github.ref == 'refs/heads/release'
Expand Down
9 changes: 6 additions & 3 deletions scripts/prepare_doc_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ const fetch = require("node-fetch");
// Precondition: documentation ready on /dist folder
// including docs and examples (e.g. after yarn run build && yarn run typedoc)

const branch = process.env.HEAD_BRANCH;
// See: https://docs.github.com/en/actions/reference/environment-variables
const branch = process.env.GITHUB_REF;
const commitHash = execSync("git rev-parse --short HEAD").toString().trimRight();
const refName = branch !== "master" ? commitHash : "master";
// We store releases using the short commit hash
const isReleaseBranch = branch?.includes("release");
const refName = isReleaseBranch ? commitHash : "master";

// create the following directory structure
// dist
Expand Down Expand Up @@ -55,7 +58,7 @@ interface Release {
version: string;
}

if (branch === "release") {
if (isReleaseBranch) {
const now = new Date();
// WARNING, dates are 0 indexed, hence +1
const dateString = `${now.getDate()}-${now.getMonth() + 1}-${now.getFullYear()}`;
Expand Down

0 comments on commit af3cc56

Please sign in to comment.