mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Feature/container (#170)
* support Docker container * move .ssh to /root * remove print step * change home directory for Docker container * print HOME * print home * print home * update dist file * update dirname * update CHANGELOG * add badge
This commit is contained in:
parent
0b924ac88f
commit
026e5f82bf
5 changed files with 45 additions and 0 deletions
28
.github/workflows/verify-on-container.yml
vendored
Normal file
28
.github/workflows/verify-on-container.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
||||||
|
|
||||||
|
name: Docker container on Ubuntu 20.04
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ssh:
|
||||||
|
name: Connect to github.com
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
container: ubuntu:20.04
|
||||||
|
steps:
|
||||||
|
- name: Install packages
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt -y install openssh-client git
|
||||||
|
- name: Checkout source codes
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install SSH key
|
||||||
|
uses: ./.
|
||||||
|
with:
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
known_hosts: ${{ secrets.KNOWN_HOSTS }}
|
||||||
|
- name: print created files
|
||||||
|
run: ls -l /root/.ssh
|
||||||
|
- name: git clone through SSH
|
||||||
|
run: git clone git@github.com:shimataro/ssh-key-action.git tmp
|
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Support Docker container (thanks [@kujaomega](https://github.com/kujaomega))
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Bundle dependencies (thanks [@tats-u](https://github.com/tats-u))
|
* Bundle dependencies (thanks [@tats-u](https://github.com/tats-u))
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
[![Ubuntu 20.04][image-verify-ubuntu-2004]][link-verify-ubuntu-2004]
|
[![Ubuntu 20.04][image-verify-ubuntu-2004]][link-verify-ubuntu-2004]
|
||||||
[![Ubuntu 18.04][image-verify-ubuntu-1804]][link-verify-ubuntu-1804]
|
[![Ubuntu 18.04][image-verify-ubuntu-1804]][link-verify-ubuntu-1804]
|
||||||
[![Ubuntu 16.04][image-verify-ubuntu-1604]][link-verify-ubuntu-1604]
|
[![Ubuntu 16.04][image-verify-ubuntu-1604]][link-verify-ubuntu-1604]
|
||||||
|
[![Docker container][image-verify-docker-container]][link-verify-docker-container]
|
||||||
[![Release][image-release]][link-release]
|
[![Release][image-release]][link-release]
|
||||||
[![License][image-license]][link-license]
|
[![License][image-license]][link-license]
|
||||||
[![Stars][image-stars]][link-stars]
|
[![Stars][image-stars]][link-stars]
|
||||||
|
@ -144,6 +145,8 @@ See [CHANGELOG.md](CHANGELOG.md).
|
||||||
[link-verify-ubuntu-1804]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Ubuntu+18.04%22
|
[link-verify-ubuntu-1804]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Ubuntu+18.04%22
|
||||||
[image-verify-ubuntu-1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v2
|
[image-verify-ubuntu-1604]: https://github.com/shimataro/ssh-key-action/workflows/Ubuntu%2016.04/badge.svg?event=push&branch=v2
|
||||||
[link-verify-ubuntu-1604]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Ubuntu+16.04%22
|
[link-verify-ubuntu-1604]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Ubuntu+16.04%22
|
||||||
|
[image-verify-docker-container]: https://github.com/shimataro/ssh-key-action/workflows/Docker%20container%20on%20Ubuntu%2020.04/badge.svg?event=push&branch=v2
|
||||||
|
[link-verify-docker-container]: https://github.com/shimataro/ssh-key-action/actions?query=workflow%3A%22Docker+container+on+Ubuntu+20.04%22
|
||||||
[image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg
|
[image-release]: https://img.shields.io/github/release/shimataro/ssh-key-action.svg
|
||||||
[link-release]: https://github.com/shimataro/ssh-key-action/releases
|
[link-release]: https://github.com/shimataro/ssh-key-action/releases
|
||||||
[image-license]: https://img.shields.io/github/license/shimataro/ssh-key-action.svg
|
[image-license]: https://img.shields.io/github/license/shimataro/ssh-key-action.svg
|
||||||
|
|
|
@ -485,6 +485,10 @@ function getHomeDirectory() {
|
||||||
if (home === undefined) {
|
if (home === undefined) {
|
||||||
throw Error(`${homeEnv} is not defined`);
|
throw Error(`${homeEnv} is not defined`);
|
||||||
}
|
}
|
||||||
|
if (home === "/github/home") {
|
||||||
|
// Docker container
|
||||||
|
return "/root";
|
||||||
|
}
|
||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,6 +84,12 @@ function getHomeDirectory(): string
|
||||||
throw Error(`${homeEnv} is not defined`);
|
throw Error(`${homeEnv} is not defined`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(home === "/github/home")
|
||||||
|
{
|
||||||
|
// Docker container
|
||||||
|
return "/root";
|
||||||
|
}
|
||||||
|
|
||||||
return home;
|
return home;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue