fix(app/action): add --rm to auto-clean docker images
This commit is contained in:
@@ -8,7 +8,7 @@ A machine with a recent version of [docker](https://www.docker.com/) is required
|
|||||||
|
|
||||||
The command to use is similar to the following:
|
The command to use is similar to the following:
|
||||||
```shell
|
```shell
|
||||||
docker run --env INPUT_TOKEN=**** --env INPUT_USER=user --volume=/tmp:/renders ghcr.io/lowlighter/metrics:latest
|
docker run --rm --env INPUT_TOKEN=**** --env INPUT_USER=user --volume=/tmp:/renders ghcr.io/lowlighter/metrics:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
To pass parameters, pass environment variable with the same name as the corresponding action option but in uppercase and prefixed with `INPUT_`.
|
To pass parameters, pass environment variable with the same name as the corresponding action option but in uppercase and prefixed with `INPUT_`.
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ PUBLISHED_PORT=80
|
|||||||
|
|
||||||
And start the container using the following command:
|
And start the container using the following command:
|
||||||
```shell
|
```shell
|
||||||
docker run --entrypoint="" -p=127.0.0.1:$PUBLISHED_PORT:$SERVICE_PORT --volume=$SETTINGS:/metrics/settings.json ghcr.io/lowlighter/metrics:$VERSION npm start
|
docker run --rm --entrypoint="" -p=127.0.0.1:$PUBLISHED_PORT:$SERVICE_PORT --volume=$SETTINGS:/metrics/settings.json ghcr.io/lowlighter/metrics:$VERSION npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
## 4️ Add images to your profile `README.md`
|
## 4️ Add images to your profile `README.md`
|
||||||
|
|||||||
2
.github/scripts/files/examples.yml
vendored
2
.github/scripts/files/examples.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
|||||||
- name: Screenshot markdown example
|
- name: Screenshot markdown example
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
docker run --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
docker run --rm --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
||||||
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
||||||
- name: Publish examples
|
- name: Publish examples
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
|
|||||||
2
.github/workflows/examples.yml
vendored
2
.github/workflows/examples.yml
vendored
@@ -1202,7 +1202,7 @@ jobs:
|
|||||||
- name: Screenshot markdown example
|
- name: Screenshot markdown example
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
run: |
|
run: |
|
||||||
docker run --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
docker run --rm --entrypoint="" --volume=/tmp:/tmp ghcr.io/lowlighter/metrics:master node /metrics/.github/scripts/markdown_example.mjs
|
||||||
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
sudo mv /tmp/metrics.markdown.png /metrics_renders/
|
||||||
- name: Publish examples
|
- name: Publish examples
|
||||||
if: ${{ success() || failure() }}
|
if: ${{ success() || failure() }}
|
||||||
|
|||||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
||||||
run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') .
|
run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') .
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: docker run --entrypoint="" lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') npm run test-metrics
|
run: docker run --rm --entrypoint="" lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') npm run test-metrics
|
||||||
|
|
||||||
# Run CodeQL on branch
|
# Run CodeQL on branch
|
||||||
analyze:
|
analyze:
|
||||||
|
|||||||
2
action.yml
generated
2
action.yml
generated
@@ -1244,7 +1244,7 @@ runs:
|
|||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
# Run docker image with current environment
|
# Run docker image with current environment
|
||||||
docker run --init --volume $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH --volume $METRICS_RENDERS:/renders --env-file .env $METRICS_IMAGE
|
docker run --init --rm --volume $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH --volume $METRICS_RENDERS:/renders --env-file .env $METRICS_IMAGE
|
||||||
rm .env
|
rm .env
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|||||||
2
source/app/action/action.yml
generated
2
source/app/action/action.yml
generated
@@ -99,7 +99,7 @@ runs:
|
|||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
# Run docker image with current environment
|
# Run docker image with current environment
|
||||||
docker run --init --volume $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH --volume $METRICS_RENDERS:/renders --env-file .env $METRICS_IMAGE
|
docker run --init --rm --volume $GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH --volume $METRICS_RENDERS:/renders --env-file .env $METRICS_IMAGE
|
||||||
rm .env
|
rm .env
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user