-
Notifications
You must be signed in to change notification settings - Fork 9
90 lines (84 loc) · 3 KB
/
deploy.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
name: Deploy Stuff 🧙♂️
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-[a-z]+"
jobs:
swagger-ui:
runs-on: ubuntu-latest
steps:
- name: Generate Swagger UI
uses: Legion2/swagger-ui-action@v1
with:
output: swagger-ui
spec-file: swagger.yml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui
docker:
name: Docker
runs-on: ubuntu-latest
env:
GIT_LFS_SKIP_SMUDGE: 1
REGISTRY_URL: ghcr.io
strategy:
fail-fast: true
matrix:
docker:
[
{ image: namada-indexer-chain, context: chain },
{ image: namada-indexer-governance, context: governance },
{ image: namada-indexer-pos, context: pos },
{ image: namada-indexer-rewards, context: rewards },
{ image: namada-indexer-seeder, context: seeder },
{ image: namada-indexer-webserver, context: webserver },
{ image: namada-indexer-parameters, context: parameters },
{ image: namada-indexer-transactions, context: transactions },
]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- id: get_version
uses: battila7/get-version-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
id: push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.docker.context }}/Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ env.REGISTRY_URL }}/anoma/namada-indexer:${{ matrix.docker.image }}-${{ steps.get_version.outputs.version-without-v }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
swagger-npm-package:
runs-on: ubuntu-latest
steps:
- id: get_version
uses: battila7/get-version-action@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Generate Typescript Client
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: typescript-axios
openapi-file: swagger.yml
- name: Update package.json
run: python3 .github/workflows/scripts/update-package.py typescript-axios/package.json ${{ steps.get_version.outputs.version-without-v }}
- name: Publish package
run: cd typescript-axios && npm publish --access public --verbose