Skip to content

Docker dev

Docker dev #144

Workflow file for this run

name: Docker dev
on:
workflow_run:
workflows: ["CI"]
branches: ["main"]
types:
- completed
env:
FORCE_COLOR: 3
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
DATABASE_URL: postgresql://blobscan:s3cr3t@localhost:5432/blobscan_dev?schema=public
jobs:
release_docker:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build docker images (API, Web)
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: blobscan_dev
POSTGRES_USER: blobscan
POSTGRES_PASSWORD: s3cr3t
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Setup
uses: ./tooling/github/setup
- name: Setup DB
uses: ./tooling/github/setup-db
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Github ENV variables
shell: bash
run: |
echo "BUILD_TIMESTAMP=$(date '+%F %H:%M:%S')" >> $GITHUB_ENV
echo "GIT_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "NEXT_PUBLIC_BLOBSCAN_RELEASE=$(git describe --tags)" >> $GITHUB_ENV
- name: Build and push (api)
uses: docker/build-push-action@v6.5.0
with:
context: .
push: true
target: api
tags: blossomlabs/blobscan-api:development
build-args: |
NEXT_PUBLIC_BLOBSCAN_RELEASE=${{ env.NEXT_PUBLIC_BLOBSCAN_RELEASE }}
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
GIT_COMMIT=${{ env.GIT_COMMIT }}
DATABASE_URL=${{ env.DATABASE_URL }}
- name: Build and push (web)
uses: docker/build-push-action@v6.5.0
with:
context: .
push: true
target: web
tags: blossomlabs/blobscan-web:development
build-args: |
NEXT_PUBLIC_BLOBSCAN_RELEASE=${{ env.NEXT_PUBLIC_BLOBSCAN_RELEASE }}
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }}
GIT_COMMIT=${{ env.GIT_COMMIT }}
DATABASE_URL=${{ env.DATABASE_URL }}