Skip to content

chore: version packages (#624) #438

chore: version packages (#624)

chore: version packages (#624) #438

Workflow file for this run

name: Docker
on:
push:
tags: ["v*"]
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:
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: Extract metadata (tags, labels) for Docker (API)
id: meta_api
uses: docker/metadata-action@v5
with:
images: blossomlabs/blobscan-api
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push (api)
uses: docker/[email protected]
with:
context: .
push: true
target: api
tags: ${{ steps.meta_api.outputs.tags }}
labels: ${{ steps.meta_api.outputs.labels }}
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: Extract metadata (tags, labels) for Docker (Web)
id: meta_web
uses: docker/metadata-action@v5
with:
images: blossomlabs/blobscan-web
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push (web)
uses: docker/[email protected]
with:
context: .
push: true
target: web
tags: ${{ steps.meta_web.outputs.tags }}
labels: ${{ steps.meta_web.outputs.labels }}
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 }}