Skip to content

Commit

Permalink
feat: add indexer build action
Browse files Browse the repository at this point in the history
  • Loading branch information
daoleno committed Mar 3, 2024
1 parent 0adb04c commit b53b150
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/indexer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: DockerBuild

on:
push:
# branches: [main]
tags:
- indexer-v*
# pull_request:
# branches: [main]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Setup variables
id: vars
run: |
TAG="${GITHUB_REF##*/}"
echo "::set-output name=tag::${TAG%%/*}"
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./indexer
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.vars.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit b53b150

Please sign in to comment.