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: Deploy Stuff 🧙♂️ | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-[a-z]+" | |
branches: | |
- testiii | |
jobs: | |
swagger-ui: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Generate Swagger UI | |
uses: Legion2/swagger-ui-action@v1 | |
with: | |
output: swagger-ui | |
spec-file: swagger.yml | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'swagger-ui' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
docker: | |
name: Docker | |
runs-on: ubuntu-latest | |
env: | |
GIT_LFS_SKIP_SMUDGE: 1 | |
REGISTRY_URL: ghcr.io | |
strategy: | |
fail-fast: true | |
matrix: | |
docker: | |
[ | |
{ image: chain, package: chain }, | |
{ image: governance, package: governance }, | |
{ image: pos, package: pos }, | |
{ image: rewards, package: rewards }, | |
{ image: seeder, package: seeder }, | |
{ image: webserver, package: webserver }, | |
{ image: parameters, package: parameters }, | |
{ image: transactions, package: 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: Dockerfile | |
build-args: PACKAGE=${{ matrix.docker.package }} | |
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: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- 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-client/package.json ${{ steps.get_version.outputs.version-without-v }} | |
- name: Publish package | |
run: cd typescript-axios && npm publish --access public --verbose --dry-run |