Post-release #37
Workflow file for this run
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
name: Post-release | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
publish: | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
network: [ "mainnet", "preprod", "preview", "sanchonet" ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π₯ Checkout repository | |
uses: actions/checkout@v2.3.1 | |
with: | |
submodules: true | |
- 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: π³ Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: π Base Variables | |
id: base-variables | |
run: | | |
echo ::set-output name=cardano-graphql-server-image::cardanofoundation/cardano-graphql | |
echo ::set-output name=cardano-graphql-hasura-image::cardanofoundation/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: ${{ 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 | |
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: ${{ steps.base-variables.outputs.cardano-graphql-hasura-image }}:${{ github.sha }}, cardanofoundation/cardano-graphql-hasura:${{ github.event.release.tag_name }}, cardanofoundation/cardano-graphql-hasura:latest | |
- name: π€ Publish packages to npm registry | |
if: ${{ matrix.network == 'mainnet' }} | |
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 | |
rm -f .npmrc | |
- name: π¨ Build docs | |
if: ${{ matrix.network == 'mainnet' }} | |
run: | | |
yarn --cwd ./docs install --frozen-lockfile | |
yarn --cwd ./docs build | |
env: | |
SKIP_PREFLIGHT_CHECK: true | |
- name: π€ Deploy | |
if: ${{ matrix.network == 'mainnet' }} | |
uses: JamesIves/github-pages-deploy-action@4.0.0 | |
with: | |
branch: gh-pages | |
folder: docs/build |