Skip to content

Commit 5e487ce

Browse files
authored
Fix the docker workflow (#505)
Two issues... first, moved the docker workflow to be triggered exclusively through interactive request. The policy for automated triggering can be determined at a later time. Second, fixed a couple bugs in the docker workflow. Now that the workflow is a part of the main branch, debugging is far easier. Note that this is been tested on a personal repository but not on an organizational repository such as hyperledger. Signed-off-by: Mic Bowman <[email protected]>
1 parent 832f89f commit 5e487ce

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

Diff for: .github/workflows/docker.yml

+22-9
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,32 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5+
# This workflow will generate docker images for the
6+
# current branch and push those images into the
7+
# repository owners resources.
8+
59
name: Build and Push PDO Docker Images
610

711
on:
812
workflow_dispatch:
913

10-
pull_request:
11-
types: [closed]
12-
branches: [main]
14+
# This section is commented out for the moment until a
15+
# reasonable policy is determined for automated generation.
16+
# The conditional execution must be evaluated as well. These
17+
# are left here to serve as potential documentation for how
18+
# the policy may be implemented.
19+
20+
# pull_request:
21+
# types: [closed]
22+
# branches: [main]
1323

1424
jobs:
1525

1626
docker_build:
1727

18-
if: >
19-
github.event.name == 'workflow_dispatch' ||
20-
github.event.name == 'pull_request' && github.event.pull_request.merged == true
28+
# if: >
29+
# github.event.name == 'workflow_dispatch' ||
30+
# github.event.name == 'pull_request' && github.event.pull_request.merged == true
2131
name: Build PDO Images
2232
runs-on: ubuntu-22.04
2333

@@ -54,10 +64,13 @@ jobs:
5464
password: ${{ secrets.GITHUB_TOKEN }}
5565

5666
- name: Tag and push the images
67+
env:
68+
OWNER: ${{ github.repository_owner }}
5769
run: |
70+
echo "Push images to ghcr.io/$OWNER"
5871
for image in pdo_services pdo_ccf pdo_client
5972
do
60-
docker image tag ghcr.io/{{ github.repository_owner }}/$image:$PDO_VERSION
61-
docker image tag ghcr.io/{{ github.repository_owner }}/$image:latest
62-
docker image push --all-tags ghcr.io/{{ github.repository_owner }}/$image
73+
docker image tag $image:$PDO_VERSION ghcr.io/$OWNER/$image:$PDO_VERSION
74+
docker image tag $image:$PDO_VERSION ghcr.io/$OWNER/$image:latest
75+
docker image push --all-tags ghcr.io/$OWNER/$image
6376
done

0 commit comments

Comments
 (0)