Skip to content

Commit 70ebc81

Browse files
committed
Add git submodule plato to CI's conditional paths
1 parent 65283af commit 70ebc81

File tree

1 file changed

+14
-28
lines changed

1 file changed

+14
-28
lines changed

.github/workflows/docker.yaml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
# Experiments:
2+
# [x] Can I read env.IMAGE_NAME?
3+
# [x] Can I print git event name?
4+
# [x] Can I recognize pull requests?
5+
# [] Can I use if conditions for steps?
16
name: Docker CI
27

38
on:
49
push:
5-
branches: main
6-
paths:
7-
- '*.Dockerfile'
8-
- '*.Dockerfile.dockerignore'
9-
- '.github/workflows/*.yaml'
10-
pull_request:
11-
branches: main
10+
branches: try-ci-conditionals
1211
paths:
1312
- '*.Dockerfile'
1413
- '*.Dockerfile.dockerignore'
1514
- '.github/workflows/*.yaml'
15+
- plato
1616

1717
env:
1818
REGISTRY: ghcr.io
@@ -42,34 +42,20 @@ jobs:
4242
# https://github.com/docker/metadata-action
4343
- name: Extract Docker metadata
4444
id: meta
45-
uses: docker/metadata-action@v5
46-
with:
47-
images: ${{ env.IMAGE_NAME }}
48-
flavor: latest=true
45+
if: ${{ github.event_name != 'pull_request' }}
46+
run: echo 'Extract Docker metadata'
4947

5048
- name: Log into registry ${{ env.REGISTRY }}
51-
uses: docker/login-action@v3
52-
with:
53-
registry: ${{ env.REGISTRY }}
54-
username: ${{ github.actor }}
55-
password: ${{ secrets.GITHUB_TOKEN }}
49+
if: ${{ github.event_name != 'pull_request' }}
50+
run: echo 'Log into registry'
5651

5752
# Build and push Docker image with Buildx (don't push on PR)
5853
# https://github.com/docker/build-push-action
5954
- name: Build and push Docker image
6055
id: build-and-push
61-
uses: docker/build-push-action@v6
62-
with:
63-
file: ${{ matrix.purpose }}.Dockerfile
64-
context: ./plato
65-
push: ${{ github.event_name != 'pull_request' }}
66-
tags: ${{ steps.meta.outputs.tags }}
67-
labels: ${{ steps.meta.outputs.labels }}
56+
run: echo 'Build and push Docker image'
6857

6958
- name: Check image layers
59+
if: ${{ github.event_name != 'pull_request' }}
7060
id: check-layers
71-
run: |
72-
set -eux -o pipefail
73-
docker pull ${{ env.IMAGE_NAME }}
74-
docker images
75-
docker image history ${{ env.IMAGE_NAME }}
61+
run: echo 'Check image layers'

0 commit comments

Comments
 (0)