Skip to content

Update artifacts-in-reusable-called.yml #94

Update artifacts-in-reusable-called.yml

Update artifacts-in-reusable-called.yml #94

name: Service Containers Cached
on:
workflow_dispatch:
push:
jobs:
container-job:
runs-on: ubuntu-latest
services:
nginx:
image: nginx
ports:
- 8080:80
steps:
- run: mkdir -p ~/docker-image-cache
- id: docker-image-cache
uses: actions/cache@v1
with:
path: ~/docker-image-cache
key: docker-image-cache-${{ runner.os }}
- if: steps.image-cache.outputs.cache-hit != 'true'
run: |
docker pull nginx
docker save -o ~/docker-image-cache/nginx.tar nginx
- if: steps.image-cache.outputs.cache-hit == 'true'
run: docker load -i ~/docker-image-cache/nginx.tar
- run: sudo apt-get update && sudo apt-get install -y telnet
- run: telnet nginx 80