Skip to content

Build Indexer Docker and deploy #129

Build Indexer Docker and deploy

Build Indexer Docker and deploy #129

name: Build Indexer Docker and deploy
on:
push:
branches:
- main
workflow_dispatch:
release:
types: [ published ]
defaults:
run:
working-directory: starcoin-indexer
jobs:
build-starcoin-docker:
name: build starcoin-indexer docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: starcoin/starcoin_indexer
tag-sha: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.6.0
with:
driver: docker
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: maven-settings-xml-action
uses: whelk-io/maven-settings-xml-action@v18
with:
repositories: '[{ "id": "github", "url": "https://maven.pkg.github.com/starcoinorg/*" }]'
servers: '[{ "id": "github", "username": "${{ github.actor }}", "password": "${{ secrets.GIT_PACKAGE_TOKEN }}" }]'
output_file: settings.xml
- name: Build and push
uses: docker/build-push-action@v2.7.0
with:
context: .
file: starcoin-indexer/deploy/Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}