mirror of
https://github.com/addnab/docker-run-action.git
synced 2025-01-14 00:27:58 +08:00
Update README.md
This commit is contained in:
parent
e48328783a
commit
702ff8ec17
44
README.md
44
README.md
@ -1,33 +1,25 @@
|
|||||||
# Docker Run Action
|
# Docker Run Action
|
||||||
|
|
||||||
Github Workflows already supports running on public docker images out-of-the-box (See [jobs.<jobs_id>.container](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontainer)).
|
- run a privately-owned image.
|
||||||
|
- run an image built by a previous step.
|
||||||
|
- run a specific step in docker.
|
||||||
|
- See https://github.com/addnab/docker-run-action/blob/main/action.yml for all the available inputs.
|
||||||
|
|
||||||
### Then why use docker-run-action?
|
#### Typical Use Case
|
||||||
- run on a privately-owned image.
|
|
||||||
- run on an image built by a previous step.
|
|
||||||
- run a specific step in docker
|
|
||||||
|
|
||||||
### Example Usage
|
|
||||||
|
|
||||||
#### single-line command
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: addnab/docker-run-action@v1
|
- uses: addnab/docker-run-action@v1
|
||||||
with:
|
with:
|
||||||
image: docker:latest
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
run: echo "hello world"
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
```
|
registry: gcr.io
|
||||||
|
image: private-image:latest
|
||||||
#### multi-line commands
|
options: -v $GITHUB_WORKSPACE:/work -e ABC=123
|
||||||
```yaml
|
|
||||||
- uses: addnab/docker-run-action@v1
|
|
||||||
with:
|
|
||||||
image: docker:latest
|
|
||||||
run: |
|
run: |
|
||||||
echo "first line"
|
./run-script
|
||||||
echo "second line"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### run on a privately-owned image
|
#### run a privately-owned image
|
||||||
```yaml
|
```yaml
|
||||||
- uses: addnab/docker-run-action@v1
|
- uses: addnab/docker-run-action@v1
|
||||||
with:
|
with:
|
||||||
@ -38,7 +30,7 @@ Github Workflows already supports running on public docker images out-of-the-box
|
|||||||
run: echo "hello world"
|
run: echo "hello world"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### run on an image built by a previous step
|
#### run an image built by a previous step
|
||||||
```yaml
|
```yaml
|
||||||
- uses: docker/build-push-action@v1
|
- uses: docker/build-push-action@v1
|
||||||
with:
|
with:
|
||||||
@ -62,13 +54,3 @@ Github Workflows already supports running on public docker images out-of-the-box
|
|||||||
echo "first line"
|
echo "first line"
|
||||||
echo "second line"
|
echo "second line"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### use docker options
|
|
||||||
```yaml
|
|
||||||
- uses: addnab/docker-run-action@v1
|
|
||||||
with:
|
|
||||||
image: docker:latest
|
|
||||||
options: -v $GITHUB_WORKSPACE:/work -e ABC=123
|
|
||||||
run: |
|
|
||||||
echo "first line"
|
|
||||||
```
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user