diff --git a/core/plugins/stack/docker/mod.ts b/core/plugins/stack/docker/mod.ts new file mode 100644 index 0000000..c47ae49 --- /dev/null +++ b/core/plugins/stack/docker/mod.ts @@ -0,0 +1,20 @@ +import { Introspector } from "../deps.ts"; + +/** + * Introspected information about a project with Docker + */ +export default interface DockerProject { + hasDockerImage: true; +} + +export const introspector: Introspector = { + detect: async (context) => { + return await context.files.includes("./Dockerfile"); + }, + introspect: async (context) => { + const logger = await context.getLogger("docker"); + logger.info("Found docker image on root"); + + return { hasDockerImage: true }; + }, +}; diff --git a/core/templates/github/docker/build.yml b/core/templates/github/docker/build.yml new file mode 100644 index 0000000..9136c54 --- /dev/null +++ b/core/templates/github/docker/build.yml @@ -0,0 +1,15 @@ +name: Docker Image CI + +on: + pull_request: + paths: + - "Dockerfile" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag image:$(date +%s) diff --git a/core/templates/github/docker/lint.yml b/core/templates/github/docker/lint.yml new file mode 100644 index 0000000..81e6b8e --- /dev/null +++ b/core/templates/github/docker/lint.yml @@ -0,0 +1,16 @@ +name: Docker Image CI + +on: + pull_request: + paths: + - "Dockerfile" + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: hadolint/hadolint-action@v1.5.0 + with: + dockerfile: Dockerfile