|
1 | | -name: Build and Push Docker Image for Quickstart |
2 | | - |
3 | | -on: |
4 | | - release: |
5 | | - type: [published] |
6 | | - push : |
7 | | - paths: |
8 | | - - 'src/neo4j-quickstart/**' |
9 | | - - 'tools/images/Dockerfile-neo4j' |
10 | | - - '.github/workflows/**' |
11 | | - |
12 | | -env: |
13 | | - REGISTRY: ghcr.io |
14 | | - |
15 | | -jobs: |
16 | | - build-image: |
17 | | - runs-on: ubuntu-latest |
18 | | - #if: github.ref != 'refs/heads/main' |
19 | | - permissions: |
20 | | - contents: read |
21 | | - packages: write |
22 | | - |
23 | | - steps: |
24 | | - # https://github.com/actions/checkout |
25 | | - - name: checkout repository |
26 | | - uses: actions/checkout@v4 |
27 | | - |
28 | | - - name: lowercase image name |
29 | | - run: | |
30 | | - echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}-neo4j" >> ${GITHUB_ENV} |
31 | | -
|
32 | | - # https://github.com/docker/setup-qemu-action |
33 | | - - name: Set up QEMU |
34 | | - uses: docker/setup-qemu-action@v3.0.0 |
35 | | - |
36 | | - # https://github.com/docker/setup-buildx-action |
37 | | - - name: Set up Docker Buildx |
38 | | - id: buildx |
39 | | - uses: docker/setup-buildx-action@v3.0.0 |
40 | | - |
41 | | - - name: Get current release version |
42 | | - id: release-version |
43 | | - run: | |
44 | | - version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g") |
45 | | - echo "version=${version}" >> $GITHUB_OUTPUT |
46 | | - echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT |
47 | | -
|
48 | | - # https://github.com/docker/build-push-action |
49 | | - - name: Build Docker image |
50 | | - uses: docker/build-push-action@v5.0.0 |
51 | | - with: |
52 | | - context: . |
53 | | - platforms: linux/amd64 |
54 | | - file: tools/images/Dockerfile-neo4j |
55 | | - push: false |
56 | | - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release-version.outputs.version_build }} |
57 | | - build-args: PLATFORM=cu124 |
58 | | - outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network. |
59 | | - |
60 | | - push-image: |
61 | | - runs-on: ubuntu-latest |
62 | | - #if: github.ref == 'refs/heads/main' |
63 | | - permissions: |
64 | | - contents: read |
65 | | - packages: write |
66 | | - |
67 | | - steps: |
68 | | - # https://github.com/actions/checkout |
69 | | - - name: checkout repository |
70 | | - uses: actions/checkout@v4 |
71 | | - |
72 | | - - name: lowercase image name |
73 | | - run: | |
74 | | - echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}-neo4j" >> ${GITHUB_ENV} |
75 | | -
|
76 | | - # https://github.com/docker/setup-qemu-action |
77 | | - - name: Set up QEMU |
78 | | - uses: docker/setup-qemu-action@v3.0.0 |
79 | | - |
80 | | - # https://github.com/docker/setup-buildx-action |
81 | | - - name: Set up Docker Buildx |
82 | | - id: buildx |
83 | | - uses: docker/setup-buildx-action@v3.0.0 |
84 | | - |
85 | | - - name: Get current release version |
86 | | - id: release-version |
87 | | - run: | |
88 | | - version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g") |
89 | | - echo "version=${version}" >> $GITHUB_OUTPUT |
90 | | - echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT |
91 | | -
|
92 | | - # https://github.com/docker/login-action |
93 | | - - name: Log in to the Container registry |
94 | | - uses: docker/login-action@v3.0.0 |
95 | | - with: |
96 | | - registry: ${{ env.REGISTRY }} |
97 | | - username: ${{ github.actor }} |
98 | | - password: ${{ secrets.GITHUB_TOKEN }} |
99 | | - |
100 | | - # https://github.com/docker/metadata-action |
101 | | - - name: Extract metadata (tags, labels) for Docker |
102 | | - id: meta |
103 | | - uses: docker/metadata-action@v5.0.0 |
104 | | - with: |
105 | | - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
106 | | - tags: | |
107 | | - type=raw,value=latest,enable=${{ github.event_name == 'push' }} |
108 | | - type=raw,value=${{ needs.build-image.outputs.version }},enable=${{ github.event_name == 'release' }} |
109 | | - |
110 | | - # https://github.com/docker/build-push-action |
111 | | - - name: Push Docker image |
112 | | - uses: docker/build-push-action@v5.0.0 |
113 | | - with: |
114 | | - context: . |
115 | | - platforms: linux/amd64 |
116 | | - file: tools/images/Dockerfile-neo4j |
117 | | - push: true |
118 | | - tags: ${{ steps.meta.outputs.tags }} |
119 | | - labels: ${{ steps.meta.outputs.labels }} |
120 | | - build-args: PLATFORM=cu124 |
121 | | - outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network. |
| 1 | +name: Build and Push Docker Image for Quickstart |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + type: [published] |
| 6 | + push : |
| 7 | + paths: |
| 8 | + - 'src/neo4j-quickstart/**' |
| 9 | + - 'tools/images/Dockerfile-neo4j' |
| 10 | + - '.github/workflows/**' |
| 11 | + |
| 12 | +env: |
| 13 | + REGISTRY: ghcr.io |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-image: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + #if: github.ref != 'refs/heads/main' |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + packages: write |
| 22 | + |
| 23 | + steps: |
| 24 | + # https://github.com/actions/checkout |
| 25 | + - name: checkout repository |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: lowercase image name |
| 29 | + run: | |
| 30 | + echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}-neo4j" >> ${GITHUB_ENV} |
| 31 | +
|
| 32 | + # https://github.com/docker/setup-qemu-action |
| 33 | + - name: Set up QEMU |
| 34 | + uses: docker/setup-qemu-action@v3.0.0 |
| 35 | + |
| 36 | + # https://github.com/docker/setup-buildx-action |
| 37 | + - name: Set up Docker Buildx |
| 38 | + id: buildx |
| 39 | + uses: docker/setup-buildx-action@v3.0.0 |
| 40 | + |
| 41 | + - name: Get current release version |
| 42 | + id: release-version |
| 43 | + run: | |
| 44 | + version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g") |
| 45 | + echo "version=${version}" >> $GITHUB_OUTPUT |
| 46 | + echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT |
| 47 | +
|
| 48 | + # https://github.com/docker/build-push-action |
| 49 | + - name: Build Docker image |
| 50 | + uses: docker/build-push-action@v5.0.0 |
| 51 | + with: |
| 52 | + context: . |
| 53 | + platforms: linux/amd64 |
| 54 | + file: tools/images/Dockerfile-neo4j |
| 55 | + push: false |
| 56 | + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.release-version.outputs.version_build }} |
| 57 | + build-args: PLATFORM=cu124 |
| 58 | + outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network. |
| 59 | + |
| 60 | + push-image: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + #if: github.ref == 'refs/heads/main' |
| 63 | + permissions: |
| 64 | + contents: read |
| 65 | + packages: write |
| 66 | + |
| 67 | + steps: |
| 68 | + # https://github.com/actions/checkout |
| 69 | + - name: checkout repository |
| 70 | + uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: lowercase image name |
| 73 | + run: | |
| 74 | + echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}-neo4j" >> ${GITHUB_ENV} |
| 75 | +
|
| 76 | + # https://github.com/docker/setup-qemu-action |
| 77 | + - name: Set up QEMU |
| 78 | + uses: docker/setup-qemu-action@v3.0.0 |
| 79 | + |
| 80 | + # https://github.com/docker/setup-buildx-action |
| 81 | + - name: Set up Docker Buildx |
| 82 | + id: buildx |
| 83 | + uses: docker/setup-buildx-action@v3.0.0 |
| 84 | + |
| 85 | + - name: Get current release version |
| 86 | + id: release-version |
| 87 | + run: | |
| 88 | + version=$(grep -E '^version += +' pyproject.toml | sed -E 's/.*= +//' | sed "s/['\"]//g") |
| 89 | + echo "version=${version}" >> $GITHUB_OUTPUT |
| 90 | + echo "version_build=${version}_"$(git rev-parse --short "$GITHUB_SHA") >> $GITHUB_OUTPUT |
| 91 | +
|
| 92 | + # https://github.com/docker/login-action |
| 93 | + - name: Log in to the Container registry |
| 94 | + uses: docker/login-action@v3.0.0 |
| 95 | + with: |
| 96 | + registry: ${{ env.REGISTRY }} |
| 97 | + username: ${{ github.actor }} |
| 98 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + |
| 100 | + # https://github.com/docker/metadata-action |
| 101 | + - name: Extract metadata (tags, labels) for Docker |
| 102 | + id: meta |
| 103 | + uses: docker/metadata-action@v5.0.0 |
| 104 | + with: |
| 105 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 106 | + tags: | |
| 107 | + type=raw,value=latest,enable=${{ github.event_name == 'push' }} |
| 108 | + type=raw,value=${{ needs.build-image.outputs.version }},enable=${{ github.event_name == 'release' }} |
| 109 | + |
| 110 | + # https://github.com/docker/build-push-action |
| 111 | + - name: Push Docker image |
| 112 | + uses: docker/build-push-action@v5.0.0 |
| 113 | + with: |
| 114 | + context: . |
| 115 | + platforms: linux/amd64 |
| 116 | + file: tools/images/Dockerfile-neo4j |
| 117 | + push: true |
| 118 | + tags: ${{ steps.meta.outputs.tags }} |
| 119 | + labels: ${{ steps.meta.outputs.labels }} |
| 120 | + build-args: PLATFORM=cu124 |
| 121 | + outputs: type=image,annotation-index.org.opencontainers.image.description=Run a Graph Neural Network. |
0 commit comments