-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.7 KB
/
Copy pathdocs.yml
File metadata and controls
90 lines (74 loc) · 2.7 KB
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: Build & Release Docs
on:
push:
branches:
- main
concurrency:
group: cerebro-docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
image_tag: ${{ steps.commit.outputs.short }}
image_digest: ${{ steps.docker_build.outputs.digest }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Organization Name
id: org_name
run: |
org_name=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo "org_name=$org_name" >> $GITHUB_OUTPUT
- name: Extract commit
id: commit
uses: prompt/actions-commit-hash@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Update docs from dbt manifest
run: |
pip install requests
python scripts/update_docs.py
#- name: Sync Dune queries
# if: ${{ env.DUNE_API_KEY != '' }}
# env:
# DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
# run: python scripts/sync_dune_queries.py
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ steps.org_name.outputs.org_name }}/gc-cerebro-docs:latest
ghcr.io/${{ steps.org_name.outputs.org_name }}/gc-cerebro-docs:${{ steps.commit.outputs.short }}
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true
- name: Image Summary
run: |
echo "## Docker Image Built" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| **Image** | \`ghcr.io/${{ steps.org_name.outputs.org_name }}/gc-cerebro-docs\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Tag** | \`${{ steps.commit.outputs.short }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Digest** | \`${{ steps.docker_build.outputs.digest }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Platforms** | \`linux/amd64, linux/arm64\` |" >> $GITHUB_STEP_SUMMARY