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:
|
||||
```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_`.
|
||||
|
||||
@@ -104,7 +104,7 @@ PUBLISHED_PORT=80
|
||||
|
||||
And start the container using the following command:
|
||||
```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`
|
||||
|
||||
2
.github/scripts/files/examples.yml
vendored
2
.github/scripts/files/examples.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Screenshot markdown example
|
||||
if: ${{ success() || failure() }}
|
||||
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/
|
||||
- name: Publish examples
|
||||
if: ${{ success() || failure() }}
|
||||
|
||||
4
.github/workflows/examples.yml
vendored
4
.github/workflows/examples.yml
vendored
@@ -1197,12 +1197,12 @@ jobs:
|
||||
user: lowlighter
|
||||
plugins_errors_fatal: yes
|
||||
if: ${{ success() || failure() }}
|
||||
|
||||
|
||||
|
||||
- name: Screenshot markdown example
|
||||
if: ${{ success() || failure() }}
|
||||
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/
|
||||
- name: Publish examples
|
||||
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' }}
|
||||
run: docker build -t lowlighter/metrics:$(echo ${{ github.head_ref || 'master' }} | sed 's/\//-/g') .
|
||||
- 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
|
||||
analyze:
|
||||
|
||||
596
action.yml
generated
596
action.yml
generated
File diff suppressed because it is too large
Load Diff
2
source/app/action/action.yml
generated
2
source/app/action/action.yml
generated
@@ -99,7 +99,7 @@ runs:
|
||||
echo "::endgroup::"
|
||||
|
||||
# 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
|
||||
shell: bash
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user