Skip to content

Enforce side

Enforce side #493

Workflow file for this run

name: Docker builds
on:
push:
branches:
- 'main'
- 'release'
workflow_dispatch: # adding the workflow_dispatch so it can be triggered manually
pull_request:
jobs:
ui:
strategy:
matrix:
network: [ghostnet mainnet ]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
submodules: true
- name: Set outputs
id: vars
run: |
echo "::set-output name=date::$(date +%Y-%m-%dT%H-%M-%S)"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Set up Docker Buildx
uses: docker/Setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v3
with:
file: ./batcher-ui/Dockerfile.${{ matrix.network }}
context: ./batcher-ui/
# Only push when on main
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
tags: |
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:latest
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push ticker
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v3
with:
file: ./Dockerfile.tick.${{ matrix.network }}
# Only push when on main
push: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
tags: |
ghcr.io/marigold-dev/batcher-tick-${{ matrix.network }}:latest
ghcr.io/marigold-dev/batcher-tick-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push release version
if: ${{ github.ref == 'refs/heads/release' }}
uses: docker/build-push-action@v3
with:
file: ./batcher-ui/Dockerfile.${{ matrix.network }}
context: ./batcher-ui/
push: true
tags: |
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:stable
ghcr.io/marigold-dev/batcher-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}-release
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push ticker release version
if: ${{ github.ref == 'refs/heads/release' }}
uses: docker/build-push-action@v3
with:
file: ./Dockerfile.tick.${{ matrix.network }}
push: true
tags: |
ghcr.io/marigold-dev/batcher-tick-${{ matrix.network }}:stable
ghcr.io/marigold-dev/batcher-tick-${{ matrix.network }}:${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.sha_short }}-release
cache-from: type=gha
cache-to: type=gha,mode=max