mango-feeds/.github/workflows/docker-publish.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

name: Publish Docker Image
on:
push:
branches: [main]
env:
IMAGE: mango-feeds
ORG: blockworks-foundation
REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
# Use docker buildx
- name: Use docker buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
buildkitd-flags: --debug
# Login to Registry
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push the image
- name: Build and Push Image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max