Compare commits

...

3 Commits
v0.3 ... v0.4

Author SHA1 Message Date
Webber
c55fc4eecd Properly check whether code is executed from source 2020-01-07 00:21:27 +01:00
Webber
4e59bb0d2a Always use relative path to action runner workspace 2020-01-07 00:21:27 +01:00
Webber
5952e3d2f6 Fix build path 2020-01-06 23:32:50 +01:00
3 changed files with 4 additions and 9 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -8,11 +8,11 @@ const core = require('@actions/core');
async function action() {
Action.checkCompatibility();
const { dockerfile, workspace } = Action;
const { dockerfile, workspace, rootFolder } = Action;
const { version, platform, projectPath, buildName, buildsPath, method } = Input.getFromUser();
const baseImage = new ImageTag({ version, platform });
const builtImage = await Docker.build({ path: workspace, dockerfile, baseImage });
const builtImage = await Docker.build({ path: rootFolder, dockerfile, baseImage });
await Docker.run(builtImage, { workspace, platform, projectPath, buildName, buildsPath, method });
}

View File

@@ -10,7 +10,7 @@ export default class Action {
}
static get isRunningFromSource() {
return __dirname !== 'dist';
return path.basename(__dirname) === 'model';
}
static get name() {
@@ -18,11 +18,6 @@ export default class Action {
}
static get rootFolder() {
if (!Action.isRunningLocally) {
const workspace = process.env.RUNNER_WORKSPACE;
return `${workspace}/${path.basename(workspace)}`;
}
if (Action.isRunningFromSource) {
return path.dirname(path.dirname(path.dirname(__filename)));
}