Skip to content

Commit ca04cac

Browse files
committed
feat: Add GitHub Actions workflow for pushing development Docker images
1 parent 3405e59 commit ca04cac

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Push development image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pr:
7+
description: 'PR number (if set, ignores branch above)'
8+
required: false
9+
type: string
10+
tag:
11+
description: 'Docker image tag'
12+
required: true
13+
default: 'prod'
14+
15+
jobs:
16+
dev:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
if: ${{ github.event.inputs.pr == 0 }}
22+
23+
- uses: actions/checkout@v4
24+
if: ${{ github.event.inputs.pr != 0 }}
25+
with:
26+
ref: ${{ format('refs/pull/{0}/head', github.event.inputs.pr) }}
27+
28+
- name: Login to Docker Hub
29+
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
30+
continue-on-error: true
31+
32+
- name: Build and push development image
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: .
36+
push: true
37+
tags: metabrainz/synapse:${{ github.event.inputs.tag }}
38+
build-args: GIT_COMMIT_SHA=${{ github.sha }}

0 commit comments

Comments
 (0)