Merge pull request #224 from anoma/chore/update-version-in-cargo-toml… #26
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: Deploy Stuff 🧙♂️ | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-[a-z]+" | |
branches: | |
- "v?[0-9]+.[0-9]+.[0-9]+-rc" | |
- "v?[0-9]+.[0-9]+.[0-9]+-[a-z]+-rc" | |
permissions: | |
packages: write | |
pages: write | |
id-token: write | |
contents: read | |
jobs: | |
swagger-ui: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
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 | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'swagger-ui' | |
- name: Deploy to GitHub Pages | |
if: startsWith(github.ref, 'refs/tags/v') | |
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: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
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 openapi client configuration file | |
run: python3 .github/workflows/scripts/update-package.py ${{ steps.get_version.outputs.version-without-v }} | |
- name: Generate Typescript Client | |
uses: openapi-generators/openapitools-generator-action@v1 | |
with: | |
generator: typescript-axios | |
openapi-file: swagger.yml | |
command-args: -c swagger-codegen.json -o client | |
- name: Publish package | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: cd client && npm install && npm run build && npm publish --access public --verbose |