Skip to content

Docker Image CI

Docker Image CI #139

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- build/docker
create:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Branch name
id: branch_name
run: |
echo ::set-output name=VERSION::$([[ $GITHUB_REF =~ "refs/tags" ]] && echo ${GITHUB_REF#refs/tags/} || echo "${GITHUB_SHA:0:7}")
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.docker_hub_username }}
password: ${{ secrets.docker_hub_token }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: dfuse/dfuse-eosio
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
build-args: |
VERSION=${{ steps.branch_name.outputs.VERSION }}
COMMIT=${GITHUB_SHA:0:7}
tags: |
dfuse/dfuse-eosio:latest
dfuse/dfuse-eosio:${{ steps.branch_name.outputs.VERSION }}
ghcr.io/dfuse-io/dfuse-eosio:latest
ghcr.io/dfuse-io/dfuse-eosio:${{ steps.branch_name.outputs.VERSION }}