forked from ton-studio/ton-etl
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.89 KB
/
indexer.yml
File metadata and controls
58 lines (49 loc) · 1.89 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
name: Build and deploy indexer
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
APP_ENV: ${{ github.ref == 'refs/heads/main' && 'production' || github.ref == 'refs/heads/canary' && 'canary' || github.ref == 'refs/heads/staging' && 'staging' || 'unknown' }}
permissions:
packages: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set sha-short
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
- id: lower-repo
name: Repository to lowercase
run: |
echo "repository=${GITHUB_REPOSITORY@L}" >> $GITHUB_OUTPUT
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ steps.lower-repo.outputs.repository }}-indexer
github-token: ${{ secrets.GITHUB_TOKEN }}
tags: |
type=sha
type=sha,format=long
type=ref,event=branch
- name: Build and push Docker image ${{ steps.lower-repo.outputs.repository }}-indexer:${{ env.APP_ENV }}
uses: docker/build-push-action@v6
with:
context: indexer/ton-index-worker
file: indexer/ton-index-worker/Dockerfile
push: true
tags: ghcr.io/${{ steps.lower-repo.outputs.repository }}-indexer:${{ env.GITHUB_SHA_SHORT }},ghcr.io/${{ steps.lower-repo.outputs.repository }}-indexer:${{ env.APP_ENV }}
build-args: |
sha=${{ github.sha }}
sha_short=${{ env.GITHUB_SHA_SHORT }}
app_env=${{ env.APP_ENV }}