Skip to content

Commit

Permalink
Merge pull request #20 from sun-asterisk-research/chore
Browse files Browse the repository at this point in the history
refactor: Add new GH workflow for Hasura
  • Loading branch information
kimyvgy authored Oct 16, 2023
2 parents 756a1e0 + 80c71b8 commit 1043680
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions .github/workflows/hasura.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
name: Hasura
on:
pull_request:
paths:
- .github/workflows/hasura.yml
- src/hasura/**
push:
branches: [main]
paths:
- .github/workflows/hasura.yml
- src/hasura/**

jobs:
hasura:
name: Hasura
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Apply hasura migrations
uses: tibotiber/[email protected]
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm,arm64
- name: Set up buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
args: migrate apply --all-databases
env:
HASURA_ENDPOINT: ${{ secrets.HASURA_ENDPOINT }}
HASURA_ADMIN_SECRET: ${{ secrets.HASURA_ADMIN_SECRET }}
HASURA_WORKDIR: src/hasura
HASURA_ENGINE_VERSION: v2.33.3
- name: Apply hasura metadata
uses: tibotiber/[email protected]
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
args: metadata apply
env:
HASURA_ENDPOINT: ${{ secrets.HASURA_ENDPOINT }}
HASURA_ADMIN_SECRET: ${{ secrets.HASURA_ADMIN_SECRET }}
HASURA_WORKDIR: src/hasura
HASURA_ENGINE_VERSION: v2.33.3
context: ./src/hasura
file: ./src/hasura/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: |
ghcr.io/${{ github.repository_owner }}/microservices-example/hasura:build-${{ github.run_number }}
ghcr.io/${{ github.repository_owner }}/microservices-example/hasura:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 1043680

Please sign in to comment.