Skip to content

Commit

Permalink
Merge pull request #7 from s0/dotfiles
Browse files Browse the repository at this point in the history
Allow copying of dotfiles
  • Loading branch information
s0 authored Mar 7, 2020
2 parents 693ee9e + 06ac8ba commit 43169ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on: push
jobs:
deploy-ssh-no-branch:
name: Test deploying to a new branch
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Dummy Data
run: |
mkdir dummy
echo "foobar" > "dummy/baz"
echo "foobar" > "dummy/.bat"
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
Expand All @@ -33,13 +34,14 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }}
deploy-ssh-existing-branch:
name: Test deploying to a pre-existing branch
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Dummy Data
run: |
mkdir dummy
echo "foobar" > "dummy/baz"
echo "foobar" > "dummy/.bat"
- name: Deploy
uses: ./
env:
Expand All @@ -49,13 +51,14 @@ jobs:
SSH_PRIVATE_KEY: ${{ secrets.TESTING_PRIVATE_KEY }}
deploy-ssh-existing-branch-known_hosts:
name: Test deploying to a pre-existing branch (with KNOWN_HOSTS_FILE)
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Dummy Data
run: |
mkdir dummy
echo "foobar" > "dummy/baz"
echo "foobar" > "dummy/.bat"
- name: Deploy
uses: ./
env:
Expand All @@ -66,15 +69,17 @@ jobs:
KNOWN_HOSTS_FILE: action/resources/known_hosts_github.com
deploy-ssh-twice:
name: Test deploying multiple times in one job
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Dummy Data
run: |
mkdir dummy1
echo "foobar1" > "dummy1/baz"
echo "foobar1" > "dummy1/.bat"
mkdir dummy2
echo "foobar2" > "dummy2/baz"
echo "foobar2" > "dummy2/.bat"
- name: Deploy
uses: ./
env:
Expand All @@ -98,6 +103,7 @@ jobs:
run: |
mkdir dummy
echo "foobar" > "dummy/baz"
echo "foobar" > "dummy/.bat"
- name: Deploy
uses: ./
env:
Expand Down
2 changes: 1 addition & 1 deletion action/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ var writeToProcess = function (command, args, opts) { return new Promise(functio
folder = path.resolve(process.cwd(), config.folder);
console.log("##[info] Copying all files from " + folder);
// TODO: replace this copy with a node implementation
return [4 /*yield*/, exec("cp -r " + folder + "/* ./", { env: env, cwd: REPO_TEMP })];
return [4 /*yield*/, exec("cp -rT " + folder + "/ ./", { env: env, cwd: REPO_TEMP })];
case 25:
// TODO: replace this copy with a node implementation
_e.sent();
Expand Down
2 changes: 1 addition & 1 deletion action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const writeToProcess = (command: string, args: string[], opts: {env: { [id: stri
const folder = path.resolve(process.cwd(), config.folder);
console.log(`##[info] Copying all files from ${folder}`);
// TODO: replace this copy with a node implementation
await exec(`cp -r ${folder}/* ./`, { env, cwd: REPO_TEMP });
await exec(`cp -rT ${folder}/ ./`, { env, cwd: REPO_TEMP });
await exec(`git add -A .`, { env, cwd: REPO_TEMP });
await exec(`git commit --allow-empty -m "Update ${config.branch} to output generated at ${sha}"`, { env, cwd: REPO_TEMP });
console.log(`##[info] Pushing`);
Expand Down

0 comments on commit 43169ff

Please sign in to comment.