|
14 | 14 | branches: [ "main" ] |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - build: |
18 | | - runs-on: ubuntu-latest |
19 | | - permissions: |
20 | | - contents: read |
21 | | - packages: write |
22 | | - # This is used to complete the identity challenge |
23 | | - # with sigstore/fulcio when running outside of PRs. |
24 | | - id-token: write |
25 | | - |
26 | | - steps: |
27 | | - - name: Checkout repository |
28 | | - uses: actions/checkout@v4 |
29 | | - |
30 | | - # Set up BuildKit Docker container builder to be able to build |
31 | | - # multi-platform images and export cache |
32 | | - # https://github.com/docker/setup-buildx-action |
33 | | - - name: Set up Docker Buildx |
34 | | - uses: docker/setup-buildx-action@v3 |
35 | | - |
36 | | - # Login against a Docker registry except on PR |
37 | | - # https://github.com/docker/login-action |
38 | | - - name: Log into registry ${{ env.REGISTRY }} |
39 | | - if: github.event_name != 'pull_request' |
40 | | - uses: docker/login-action@v3 |
41 | | - with: |
42 | | - registry: ${{ vars.DOCKER_REGISTRY }} |
43 | | - username: ${{ secrets.DOCKER_REGISTRY_USER }} |
44 | | - password: ${{ secrets.DOCKER_REGISTRY_SECRET }} |
45 | | - |
46 | | - # Extract metadata (tags, labels) for Docker |
47 | | - # https://github.com/docker/metadata-action |
48 | | - - name: Extract Docker metadata |
49 | | - id: meta |
50 | | - uses: docker/metadata-action@v5 |
51 | | - with: |
52 | | - images: ${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_REGISTRY_PROJECT }}/${{ github.repository }} |
53 | | - |
54 | | - # Build and push Docker image with Buildx (don't push on PR) |
55 | | - # https://github.com/docker/build-push-action |
56 | | - - name: Build and push Docker image |
57 | | - id: build-and-push |
58 | | - uses: docker/build-push-action@v5 |
59 | | - with: |
60 | | - context: . |
61 | | - push: ${{ github.event_name != 'pull_request' }} |
62 | | - tags: ${{ steps.meta.outputs.tags }} |
63 | | - labels: ${{ steps.meta.outputs.labels }} |
64 | | - cache-from: type=gha |
65 | | - cache-to: type=gha,mode=max |
66 | | - |
| 17 | + call-docker-build: |
| 18 | + uses: ethdevops/workflows/.github/workflows/basic-docker-build.yaml@main |
| 19 | + secrets: |
| 20 | + docker_registry_user: ${{ secrets.DOCKER_REGISTRY_USER }} |
| 21 | + docker_registry_password: ${{ secrets.DOCKER_REGISTRY_SECRET }} |
0 commit comments