mango-v4/.github/workflows/ci-docker-publish.yml

61 lines
1.5 KiB
YAML
Raw Normal View History

name: Publish Docker Image to GHCR
2022-11-05 06:10:34 -07:00
on:
push:
branches: [deploy]
paths:
[
'.github/ci-docker-publish.yml',
'programs/**',
'lib/client/**',
'bin/keeper/**',
'bin/liquidator/**',
'bin/settler/**',
'bin/service-mango-crank/**',
'bin/service-mango-fills/**',
'bin/service-mango-orderbook/**',
'bin/service-mango-pnl/**',
]
2022-11-05 06:10:34 -07:00
workflow_dispatch:
env:
IMAGE: mango-v4
REGISTRY: ghcr.io
jobs:
2022-08-08 12:14:07 -07:00
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2022-08-02 09:59:59 -07:00
with:
submodules: recursive
2022-08-04 06:20:47 -07:00
# Use docker buildx
- name: Use docker buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
2022-08-04 08:59:40 -07:00
buildkitd-flags: --debug
2022-08-04 06:20:47 -07:00
# Login to Registry
- name: Login to Registry
2022-08-02 11:52:07 -07:00
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push the base image, leveraging layer caching
- name: Build and Push Base Image
2022-08-02 11:52:07 -07:00
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/blockworks-foundation/${{ env.IMAGE }}:${{ github.sha }}
${{ env.REGISTRY }}/blockworks-foundation/${{ env.IMAGE }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max