actions-docker-extract/.github/workflows/test.yml
2020-08-29 16:20:01 +01:00

50 lines
1.3 KiB
YAML

name: Test Extraction Action
on: [push]
jobs:
extract-motd:
runs-on: ubuntu-latest
name: Extract MOTD From Alpine
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract
id: extract
uses: ./
with:
image: 'alpine'
path: '/etc/motd'
- name: Upload Extracted MOTD
uses: actions/upload-artifact@v2
with:
path: ${{ steps.extract.outputs.destination }}/motd
name: alpine-motd
example:
runs-on: ubuntu-latest
name: Extract Example From Built Image
steps:
- uses: actions/checkout@v2
- name: Create Example Dockerfile
run: |
cat <<-DOCKERFILE > Dockerfile
FROM alpine
RUN mkdir -p /app
RUN echo "Hello, World! \$(date)" > /app/example
DOCKERFILE
- name: Build Docker Image
uses: docker/build-push-action@v1
with:
repository: example
tags: ${{ github.sha }}
push: false
- uses: ./
id: extract
with:
image: example:${{ github.sha }}
path: /app
- name: Upload Dist
uses: actions/upload-artifact@v2
with:
path: ${{ steps.extract.outputs.destination }}/app
name: dist