-
Notifications
You must be signed in to change notification settings - Fork 38
88 lines (78 loc) · 2.55 KB
/
docker_dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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/[email protected]
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/[email protected]
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 }}