-
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 934 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# name: Lint and Build
on:
push:
branches:
- main
- feature/**
pull_request:
jobs:
lint-dockerfiles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Lint Dockerfile in root directory
- name: Lint Root Dockerfile
uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ./Dockerfile
# Lint Dockerfile in .devcontainer directory
- name: Lint Devcontainer Dockerfile
uses: hadolint/hadolint-action@v1.5.0
with:
dockerfile: ./.devcontainer/Dockerfile
build:
needs: lint-dockerfiles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker Image from Root
run: |
docker build -t my-app:latest .
- name: Build Docker Image from .devcontainer
run: |
docker build -f ./.devcontainer/Dockerfile -t my-devcontainer:latest .