2023-05-04 07:12:57 -07:00
|
|
|
name: Publish Docker Image to GHCR
|
2022-11-05 06:10:34 -07:00
|
|
|
|
2022-08-02 08:46:22 -07:00
|
|
|
on:
|
|
|
|
push:
|
2023-05-04 05:16:05 -07:00
|
|
|
branches: [deploy]
|
2023-02-21 03:05:07 -08:00
|
|
|
paths:
|
|
|
|
[
|
|
|
|
'.github/ci-docker-publish.yml',
|
|
|
|
'programs/**',
|
|
|
|
'lib/client/**',
|
|
|
|
'bin/keeper/**',
|
|
|
|
'bin/liquidator/**',
|
2023-03-14 11:10:24 -07:00
|
|
|
'bin/settler/**',
|
2023-10-05 01:56:45 -07:00
|
|
|
'bin/service-mango-crank/**',
|
|
|
|
'bin/service-mango-fills/**',
|
|
|
|
'bin/service-mango-orderbook/**',
|
|
|
|
'bin/service-mango-pnl/**',
|
2024-02-29 08:05:29 -08:00
|
|
|
'bin/service-mango-health/**',
|
2023-02-21 03:05:07 -08:00
|
|
|
]
|
2022-11-05 06:10:34 -07:00
|
|
|
workflow_dispatch:
|
2022-08-02 08:46:22 -07:00
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE: mango-v4
|
2023-04-17 08:57:51 -07:00
|
|
|
REGISTRY: ghcr.io
|
2022-08-02 08:46:22 -07:00
|
|
|
|
|
|
|
jobs:
|
2022-08-08 12:14:07 -07:00
|
|
|
build:
|
2022-08-02 08:46:22 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2022-08-02 09:59:59 -07:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-08-31 02:37:58 -07:00
|
|
|
|
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
|
|
|
|
2023-04-17 08:57:51 -07:00
|
|
|
# Login to Registry
|
|
|
|
- name: Login to Registry
|
2022-08-02 11:52:07 -07:00
|
|
|
uses: docker/login-action@v2
|
2022-08-02 08:46:22 -07:00
|
|
|
with:
|
2023-04-17 08:57:51 -07:00
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-08-02 08:46:22 -07:00
|
|
|
|
2022-08-31 02:37:58 -07:00
|
|
|
# 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: |
|
2023-04-17 08:57:51 -07:00
|
|
|
${{ env.REGISTRY }}/blockworks-foundation/${{ env.IMAGE }}:${{ github.sha }}
|
|
|
|
${{ env.REGISTRY }}/blockworks-foundation/${{ env.IMAGE }}:latest
|
2022-11-04 07:30:31 -07:00
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha,mode=max
|