Skip to content

Commit

Permalink
Update workflow and docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
imbhargav5 committed Dec 18, 2019
1 parent af4c611 commit 331d2c0
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/actions/get-latest-tag/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Get latest tag
description: Gets the latest tag

outputs:
latest:
description: The latest tag

runs:
using: node12
main: main.js

branding:
icon: label
17 changes: 17 additions & 0 deletions .github/actions/get-latest-tag/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const cp = require("child_process");
cp.execSync(`cd ${__dirname}; npm ci`);

const core = require("@actions/core");

const exec = cmd =>
cp
.execSync(cmd)
.toString()
.trim();

exec(`git fetch --tags`);

const latesetTag = exec(
`git describe --abbrev=0 --tags ${process.env.GITHUB_SHA}`
);
core.setOutput("latest", latesetTag);
13 changes: 13 additions & 0 deletions .github/actions/get-latest-tag/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .github/actions/get-latest-tag/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"private": true,
"name": "get-latest-tag",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.1.0"
}
}
5 changes: 4 additions & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ jobs:
run: yarn run readme-to-docs
- name: Build docusaurus
run: cd packages/docusaurus && yarn build
- name: Get latest tag info
id: latestTag
uses: ./.github/actions/get-latest-tag
- name: Version docusaurus
run: cd packages/docusaurus && yarn run docs-version $GITHUB_REF
run: cd packages/docusaurus && yarn run docs-version ${{steps.latestTag.outputs.latest}}
- name: Commit docusaurus
run: |
git add packages/docusaurus
Expand Down

0 comments on commit 331d2c0

Please sign in to comment.