Skip to content

Commit

Permalink
Feat/add docker images for background and server to pipeline (#864)
Browse files Browse the repository at this point in the history
* feat: added server and background docker image to build pipeline

* chore removed test branch
  • Loading branch information
Kammerlo authored Mar 22, 2024
1 parent 7e9c64a commit 7bd2cbc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 13 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,26 @@ jobs:
ALLOW_INTROSPECTION: true
CACHE_ENABLED: false
CARDANO_GRAPHQL_VERSION: ${{ github.sha }}

- name: 🔨 Build Cardano GraphQL Server Dockerfile
uses: docker/build-push-action@v2
with:
cache-from: type=registry,ref=inputoutput/cardano-graphql:master
cache-from: type=registry,ref=cardanofoundation/cardano-graphql-server:master
cache-to: type=inline
tags: inputoutput/cardano-graphql:${{ github.sha }}
tags: cardanofoundation/cardano-graphql:${{ github.sha }}
target: server

- name: 🔨 Build Cardano GraphQL Hasura Dockerfile
uses: docker/build-push-action@v2
with:
context: ./packages/api-cardano-db-hasura/hasura
file: ./packages/api-cardano-db-hasura/hasura/Dockerfile
tags: inputoutput/cardano-graphql-hasura:${{ github.sha }}
tags: cardanofoundation/cardano-graphql-hasura:${{ github.sha }}

- name: 🔨 Build Cardano GraphQL Background Dockerfile
uses: docker/build-push-action@v2
with:
cache-from: type=registry,ref=cardanofoundation/cardano-graphql-background:master
cache-to: type=inline
tags: cardanofoundation/cardano-graphql:${{ github.sha }}
target: background
22 changes: 17 additions & 5 deletions .github/workflows/post_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
- name: 📝 Base Variables
id: base-variables
run: |
echo ::set-output name=cardano-graphql-server-image::cardanofoundation/cardano-graphql
echo ::set-output name=cardano-graphql-image::cardanofoundation/cardano-graphql
echo ::set-output name=cardano-graphql-hasura-image::cardanofoundation/cardano-graphql-hasura
echo ::set-output name=cardano-graphql-background-image::cardanofoundation/cardano-graphql-background
echo ::set-output name=cardano-graphql-server-image::cardanofoundation/cardano-graphql-server
- name: 🔨 Build and push Cardano GraphQL Server Dockerfile (default)
if: ${{ matrix.network == 'mainnet' }}
Expand All @@ -41,9 +43,9 @@ jobs:
build-args: NETWORK=${{ matrix.network }}
context: .
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:${{ github.sha }}, ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:master
tags: ${{ steps.base-variables.outputs.cardano-graphql-image }}:${{ github.sha }}, ${{ steps.base-variables.outputs.cardano-graphql-image }}:master
target: server
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-image }}:latest
cache-to: type=inline

- name: 🔨 Build and push Cardano GraphQL Server Dockerfile (network)
Expand All @@ -66,5 +68,15 @@ jobs:
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:${{ github.sha }}, ${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:master
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:master-${{ matrix.network }}
cache-to: type=inline

cache-to: type=inline

- name: 🔨 Build and push Cardano GraphQL Background Dockerfile (network)
uses: docker/build-push-action@v2
with:
build-args: NETWORK=${{ matrix.network }}
context: .
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-background-image }}:${{ github.sha }}-${{ matrix.network }}, ${{ steps.base-variables.outputs.cardano-graphql-background-image }}:master-${{ matrix.network }}
target: server
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-background-image }}:master-${{ matrix.network }}
cache-to: type=inline
18 changes: 15 additions & 3 deletions .github/workflows/post_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ jobs:
- name: 📝 Base Variables
id: base-variables
run: |
echo ::set-output name=cardano-graphql-server-image::cardanofoundation/cardano-graphql
echo ::set-output name=cardano-graphql-image::cardanofoundation/cardano-graphql
echo ::set-output name=cardano-graphql-hasura-image::cardanofoundation/cardano-graphql-hasura
echo ::set-output name=cardano-graphql-background-image::cardanofoundation/cardano-graphql-background
echo ::set-output name=cardano-graphql-server-image::cardanofoundation/cardano-graphql-server
- name: 🔨 Build and push Cardano GraphQL Server Dockerfile (default)
if: ${{ matrix.network == 'mainnet' }}
uses: docker/build-push-action@v2
with:
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-image }}:latest
cache-to: type=inline
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:${{ github.sha }}, ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:${{ github.event.release.tag_name }}, ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest
tags: ${{ steps.base-variables.outputs.cardano-graphql-image }}:${{ github.sha }}, ${{ steps.base-variables.outputs.cardano-graphql-image }}:${{ github.event.release.tag_name }}, ${{ steps.base-variables.outputs.cardano-graphql-image }}:latest
target: server

- name: 🔨 Build and push Cardano GraphQL Server Dockerfile (network tags)
Expand All @@ -58,6 +60,16 @@ jobs:
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:${{ github.sha }}-${{ matrix.network }}, ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:${{ github.event.release.tag_name }}-${{ matrix.network }}, ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest-${{ matrix.network }}
target: server

- name: 🔨 Build and push Cardano GraphQL Server Dockerfile (network tags)
uses: docker/build-push-action@v2
with:
build-args: NETWORK=${{ matrix.network }}
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-background-image }}:latest
cache-to: type=inline
push: true
tags: ${{ steps.base-variables.outputs.cardano-graphql-background-image }}:${{ github.sha }}-${{ matrix.network }}, ${{ steps.base-variables.outputs.cardano-graphql-background-image }}:${{ github.event.release.tag_name }}-${{ matrix.network }}, ${{ steps.base-variables.outputs.cardano-graphql-background-image }}:latest-${{ matrix.network }}
target: background

- name: 🔨 Build and push Cardano GraphQL Hasura Dockerfile
uses: docker/build-push-action@v2
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ services:

background:
build:
cache_from: [ inputoutput/cardano-graphql-background:latest ]
cache_from: [ cardanofoundation/cardano-graphql-background:latest ]
context: .
target: background
image: cardanofoundation/cardano-graphql-background:${CARDANO_GRAPHQL_VERSION:-8.0.1}-${NETWORK:-mainnet}
Expand Down

0 comments on commit 7bd2cbc

Please sign in to comment.