Skip to content

replace branch

replace branch #1

# This workflow pushes new docker images to osmolabs/droid-dev:
#
# 1. Every new commit to the master branch
# `osmolabs/osmosis-dev:master-{SHORT_SHA}` is pushed.
# `osmolabs/osmosis-dev:master-{SHORT_SHA}-$(date +%s)` is pushed.
#
# Note: $(date +%s) is used to sort the tags in the docker registry.
name: Push Dev Images
on:
push:
branches:
- master
env:
DOCKER_REPOSITORY: osmolabs/cosmprund-dev
jobs:
docker:
runs-on: buildjet-2vcpu-ubuntu-2204
steps:
-
name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Create Docker Image Tags
run: |
SHORT_SHA=$(echo ${GITHUB_SHA} | cut -c1-8)
echo "DOCKER_IMAGE_TAG=${{ github.ref_name }}-${SHORT_SHA}" >> $GITHUB_ENV
echo "DOCKER_IMAGE_TAG_WITH_DATE=${{ github.ref_name }}-${SHORT_SHA}-$(date +%s)" >> $GITHUB_ENV
-
name: Build and Push Docker Images
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.DOCKER_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG }}
${{ env.DOCKER_REPOSITORY }}:${{ env.DOCKER_IMAGE_TAG_WITH_DATE }}