Skip to content

Commit 31dd179

Browse files
switch to reusable workflow
1 parent a70a27f commit 31dd179

2 files changed

Lines changed: 9 additions & 65 deletions

File tree

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
name: Docker
2-
3-
# This workflow uses actions that are not certified by GitHub.
4-
# They are provided by a third-party and are governed by
5-
# separate terms of service, privacy policy, and support
6-
# documentation.
1+
name: Build Docker image
72

83
on:
94
push:
@@ -13,14 +8,7 @@ on:
138
pull_request:
149
branches: [ "main" ]
1510

16-
env:
17-
# Use docker.io for Docker Hub if empty
18-
REGISTRY: ghcr.io
19-
# github.repository as <account>/<repo>
20-
IMAGE_NAME: ${{ github.repository }}
21-
22-
23-
jobs:
11+
jobs:
2412
lint:
2513
runs-on: ubuntu-latest
2614
steps:
@@ -60,54 +48,9 @@ jobs:
6048
echo '```' >> $GITHUB_STEP_SUMMARY
6149
pytest >> $GITHUB_STEP_SUMMARY
6250
echo '```' >> $GITHUB_STEP_SUMMARY
63-
build:
51+
ucall-docker-build:
6452
needs: test
65-
runs-on: ubuntu-latest
66-
permissions:
67-
contents: read
68-
packages: write
69-
# This is used to complete the identity challenge
70-
# with sigstore/fulcio when running outside of PRs.
71-
id-token: write
72-
73-
steps:
74-
- name: Checkout repository
75-
uses: actions/checkout@v3
76-
77-
# Set up BuildKit Docker container builder to be able to build
78-
# multi-platform images and export cache
79-
# https://github.com/docker/setup-buildx-action
80-
- name: Set up Docker Buildx
81-
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
82-
83-
# Login against a Docker registry except on PR
84-
# https://github.com/docker/login-action
85-
- name: Log into registry ${{ env.REGISTRY }}
86-
if: github.event_name != 'pull_request'
87-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
88-
with:
89-
registry: ${{ env.REGISTRY }}
90-
username: ${{ github.actor }}
91-
password: ${{ secrets.GITHUB_TOKEN }}
92-
93-
# Extract metadata (tags, labels) for Docker
94-
# https://github.com/docker/metadata-action
95-
- name: Extract Docker metadata
96-
id: meta
97-
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
98-
with:
99-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
100-
101-
# Build and push Docker image with Buildx (don't push on PR)
102-
# https://github.com/docker/build-push-action
103-
- name: Build and push Docker image
104-
id: build-and-push
105-
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
106-
with:
107-
context: .
108-
push: ${{ github.event_name != 'pull_request' }}
109-
tags: ${{ steps.meta.outputs.tags }}
110-
labels: ${{ steps.meta.outputs.labels }}
111-
cache-from: type=gha
112-
cache-to: type=gha,mode=max
113-
53+
uses: ethdevops/workflows/.github/workflows/basic-docker-build.yaml@main
54+
secrets:
55+
docker_registry_user: ${{ secrets.DOCKER_REGISTRY_USER }}
56+
docker_registry_password: ${{ secrets.DOCKER_REGISTRY_SECRET }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
.DS_Store
12
keys/
23
localstore/
34
miniostore/
4-
.idea/
5+
.idea/

0 commit comments

Comments
 (0)