-
Notifications
You must be signed in to change notification settings - Fork 104
104 lines (90 loc) · 4.67 KB
/
post_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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-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-image }}:latest
cache-to: type=inline
push: true
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)
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 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
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
# Removed push to npm for now, will add it later again
# - 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