-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: refactor workflows to publish mainnet suffixed tags to Docker Hub
Also improved the formatting
- Loading branch information
Showing
3 changed files
with
100 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,18 @@ jobs: | |
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- | ||
name: Checkout source code | ||
- name: π₯ Checkout repository | ||
uses: actions/[email protected] | ||
- | ||
name: Setup Node.js | ||
|
||
- name: π§° Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: π§° Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Compile TypeScript and lint | ||
|
||
- name: π¨ Compile TypeScript and lint | ||
run: | | ||
yarn install --offline --frozen-lockfile --non-interactive --logevel=error | ||
yarn build | ||
|
@@ -30,16 +29,16 @@ jobs: | |
ALLOW_INTROSPECTION: true | ||
CACHE_ENABLED: false | ||
CARDANO_GRAPHQL_VERSION: ${{ github.sha }} | ||
- | ||
name: Build Cardano GraphQL Dockerfile | ||
- name: π¨ Build Cardano GraphQL Server Dockerfile | ||
uses: docker/build-push-action@v2 | ||
with: | ||
cache-from: type=registry,ref=inputoutput/cardano-graphql:master | ||
cache-to: type=inline | ||
tags: inputoutput/cardano-graphql:${{ github.sha }} | ||
target: server | ||
- | ||
name: Build Cardano GraphQL Hasura Dockerfile | ||
- name: π¨ Build Cardano GraphQL Hasura Dockerfile | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./packages/api-cardano-db-hasura/hasura | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,34 +7,63 @@ on: | |
|
||
jobs: | ||
push-docker-build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04 ] | ||
network: [ "mainnet", "testnet", "alonzo-purple" ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- | ||
name: Checkout source code | ||
- name: π₯ Checkout repository | ||
uses: actions/[email protected] | ||
- | ||
name: Set up Docker Buildx | ||
- name: π§° Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to Docker Hub | ||
- name: π³ Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
- | ||
name: Build and push Cardano GraphQL Dockerfile | ||
|
||
- name: π Base Variables | ||
id: base-variables | ||
run: | | ||
echo ::set-output name=cardano-graphql-server-image::inputoutput/cardano-graphql | ||
echo ::set-output name=cardano-graphql-hasura-image::inputoutput/cardano-graphql-hasura | ||
- name: π¨ Build and push Cardano GraphQL Server Dockerfile (default latest) | ||
if: ${{ matrix.network == 'mainnet' }} | ||
uses: docker/build-push-action@v2 | ||
with: | ||
cache-from: type=registry,ref=inputoutput/cardano-graphql:master | ||
build-args: NETWORK=${{ matrix.network }} | ||
context: . | ||
push: true | ||
tags: ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest | ||
target: server | ||
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest | ||
cache-to: type=inline | ||
|
||
- name: π¨ Build and push Cardano GraphQL Server Dockerfile (network latest) | ||
uses: docker/build-push-action@v2 | ||
with: | ||
build-args: NETWORK=${{ matrix.network }} | ||
context: . | ||
push: true | ||
tags: inputoutput/cardano-graphql:${{ github.sha }}, inputoutput/cardano-graphql:master | ||
tags: ${{ steps.base-variables.outputs.cardano-graphql-server-image }}:latest-${{ matrix.network }} | ||
target: server | ||
- | ||
name: Build and push Cardano GraphQL Hasura Dockerfile | ||
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-server-image }}:master-${{ matrix.network }} | ||
cache-to: type=inline | ||
|
||
- name: π¨ Build and push Cardano GraphQL Hasura Dockerfile (network latest) | ||
uses: docker/build-push-action@v2 | ||
with: | ||
build-args: NETWORK=${{ matrix.network }} | ||
context: ./packages/api-cardano-db-hasura/hasura | ||
file: ./packages/api-cardano-db-hasura/hasura/Dockerfile | ||
push: true | ||
tags: inputoutput/cardano-graphql-hasura:${{ github.sha }}, inputoutput/cardano-graphql-hasura:master | ||
tags: ${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:latest-${{ matrix.network }} | ||
target: server | ||
cache-from: type=registry,ref=${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:master-${{ matrix.network }} | ||
cache-to: type=inline | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,58 +7,80 @@ on: | |
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-20.04 ] | ||
network: [ "mainnet", "testnet", "alonzo-purple" ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- | ||
name: Checkout source code | ||
- name: π₯ Checkout repository | ||
uses: actions/[email protected] | ||
- | ||
name: Setup Node.js | ||
|
||
- name: π§° Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: π§° Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to Docker Hub | ||
|
||
- name: π³ Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
- | ||
name: Build and push Cardano GraphQL Dockerfile | ||
|
||
- name: π Base Variables | ||
id: base-variables | ||
run: | | ||
echo ::set-output name=cardano-graphql-server-image::inputoutput/cardano-graphql | ||
echo ::set-output name=cardano-graphql-hasura-image::inputoutput/cardano-graphql-hasura | ||
- 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-to: type=inline | ||
push: true | ||
tags: inputoutput/cardano-graphql:${{ github.sha }}, inputoutput/cardano-graphql:${{ github.event.release.tag_name }}, inputoutput/cardano-graphql:latest | ||
cache-from: type=registry,ref=inputoutput/cardano-graphql:master | ||
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 | ||
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-server-image }}:latest | ||
cache-to: type=inline | ||
- | ||
name: Build and push Cardano GraphQL Hasura Dockerfile | ||
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 Hasura Dockerfile | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./packages/api-cardano-db-hasura/hasura | ||
file: ./packages/api-cardano-db-hasura/hasura/Dockerfile | ||
push: true | ||
tags: inputoutput/cardano-graphql-hasura:${{ github.sha }}, inputoutput/cardano-graphql-hasura:${{ github.event.release.tag_name }}, inputoutput/cardano-graphql-hasura:latest | ||
- | ||
name: Publish packages to npm registry | ||
tags: ${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:${{ github.sha }}, inputoutput/cardano-graphql-hasura:${{ github.event.release.tag_name }}, inputoutput/cardano-graphql-hasura:latest | ||
|
||
- name: π€ Publish packages to npm registry | ||
run: | | ||
yarn install --offline --frozen-lockfile --non-interactive --logevel=error | ||
npx npm-cli-login -u ${{ secrets.NPM_REGISTRY_USER }} -e ${{ secrets.NPM_REGISTRY_EMAIL }} -p ${{ secrets.NPM_REGISTRY_TOKEN }} | ||
scripts/publish_packages.sh | ||
if: ${{ always() }} | ||
rm -f .npmrc | ||
- | ||
name: Build docs | ||
- name: π¨ Build docs | ||
run: | | ||
yarn --cwd ./docs install --frozen-lockfile | ||
yarn --cwd ./docs build | ||
env: | ||
SKIP_PREFLIGHT_CHECK: true | ||
- | ||
name: Deploy | ||
- name: π€ Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
|