Feat/publish events to rmq #58
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: docker | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
ordinals-indexer: | |
timeout-minutes: 60 | |
runs-on: [self-hosted] | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- | |
name: Login to ECR | |
uses: docker/login-action@v3 | |
with: | |
registry: 726418723176.dkr.ecr.us-east-1.amazonaws.com | |
username: ${{ secrets.LR_PRD_AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.LR_PRD_AWS_SECRET_ACCESS_KEY }} | |
- | |
name: Build SHA tag | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- | |
name: Create Docker builder context | |
run: docker context create builders | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver: docker-container | |
endpoint: builders | |
platforms: linux/arm64 | |
version: latest | |
- | |
name: Bump version and push tag | |
uses: LooksRare/[email protected] | |
if: github.event_name != 'pull_request' | |
id: version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERBOSE: false | |
WITH_V: true | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
flavor: | | |
latest=auto | |
prefix= | |
suffix= | |
# list of Docker images to use as base name for tags | |
images: | | |
726418723176.dkr.ecr.us-east-1.amazonaws.com/ord | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
latest | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{raw}},value=${{ steps.version.outputs.tag }} | |
type=semver,pattern=v{{major}}.{{minor}},value=${{ steps.version.outputs.tag }},enable={{is_default_branch}} | |
type=semver,pattern=v{{major}},value=${{ steps.version.outputs.tag }},enable={{is_default_branch}} | |
type=sha,prefix=,format=short | |
- | |
name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |