feat: add tables for support github teams (#311) #126
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: Release | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
jobs: | |
publish-docker: | |
name: Publish Docker | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 17 | |
- name: Check .env drift | |
run: | | |
result=$(cmp --silent .env kube/base/faros/config/.env; echo $?) | |
if [[ $result -ne 0 ]]; then | |
echo "####" | |
echo "# Drift detected on configuration" | |
echo "# Ensure that 'kube/base/faros/config/.env' is identical to '.env'" | |
echo "# Execute 'cp -f .env kube/base/faros/config/.env' to sync the files" | |
echo "####" | |
exit $result | |
else | |
echo "No drift detected" | |
fi | |
- name: Build (init) | |
run: npm ci --unsafe-perm | |
working-directory: init | |
- name: Build (cli) | |
run: npm ci --unsafe-perm | |
working-directory: cli | |
- name: Run unit tests | |
run: npm run test:unit -- --coverage | |
working-directory: init | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
farosai/faros-ce-init | |
flavor: | | |
latest=auto | |
tags: | | |
type=sha,format=long,prefix= | |
type=raw,value=latest,enable=true | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
load: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Start services | |
run: FAROS_EMAIL=integration.tests@faros.ai FAROS_INIT_IMAGE=farosai/faros-ce-init:${{ github.sha }} docker compose up --quiet-pull -d | |
- name: Show logs | |
run: docker compose logs --tail all | |
- name: Show services | |
run: docker compose ps -a | |
- name: Wait for init to complete | |
run: | | |
CONTAINER_EXIT_CODE=$(docker wait faros-community-edition-faros-init-1) | |
echo "Faros init container exit code was ${CONTAINER_EXIT_CODE}" | |
[[ $CONTAINER_EXIT_CODE -eq 0 ]] | |
- name: Get Hasura Admin Secret | |
run: | | |
echo $(cat .env | grep "^HASURA_GRAPHQL_ADMIN_SECRET") >> "$GITHUB_ENV" | |
- name: Run integration tests (init) | |
run: npm run test:integration -- --coverage | |
working-directory: init | |
- name: Run integration tests (cli) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm run test:integration -- --coverage | |
working-directory: cli | |
- name: Stop services | |
run: docker compose down | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish-cli-docker: | |
name: Publish CLI Docker | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
# Build and integration tests are run in the job above. So we just build and push if the above job is successful. | |
needs: publish-docker | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: | | |
farosai/faros-ce-cli | |
flavor: | | |
latest=auto | |
tags: | | |
type=sha,format=long,prefix= | |
type=raw,value=latest,enable=true | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
file: cli/Dockerfile | |
context: cli | |
platforms: linux/amd64,linux/arm64 | |
pull: true | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |