mirror of
https://forgejo.merr.is/annika/actions-docker-extract.git
synced 2025-12-11 14:39:57 -05:00
✨ Extract path from Docker Image (#1)
This commit is contained in:
parent
f6106497d3
commit
bf80417647
11 changed files with 3800 additions and 0 deletions
50
.github/workflows/test.yml
vendored
Normal file
50
.github/workflows/test.yml
vendored
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue