Extract path from Docker Image (#1)

This commit is contained in:
Samuel Ryan 2020-08-29 16:20:01 +01:00 committed by GitHub
parent f6106497d3
commit bf80417647
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 3800 additions and 0 deletions

50
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,50 @@
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