Skip to content

Commit 9f0bdfa

Browse files
authored
Merge pull request #174 from browserstack/docker-action
feat: added Docker build and push github action
2 parents 6c979e5 + e0db30e commit 9f0bdfa

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/docker-push.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Push enigma image to Docker
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out the repo
12+
uses: actions/checkout@v3
13+
- name: Set up QEMU
14+
uses: docker/setup-qemu-action@v2
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v2
17+
- name: Docker metadata
18+
id: meta
19+
uses: docker/metadata-action@v4
20+
with:
21+
images: |
22+
browserstack/enigma
23+
tags: |
24+
type=semver,pattern=v{{version}}
25+
type=semver,pattern=v{{major}}.{{minor}}
26+
type=semver,pattern=v{{major}}
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
- name: Build and push
33+
uses: docker/build-push-action@v4
34+
with:
35+
context: .
36+
push: true
37+
platforms: linux/amd64, linux/arm64/v8
38+
target: web
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ARG APPUID=1001
2222
RUN useradd -rm -d /home/app -s /bin/bash -g root -G sudo -u "$APPUID" app
2323
WORKDIR /srv/code/dev
2424
RUN mkdir -p logs
25+
RUN mkdir -p db
2526
RUN chown -R app /srv/code/dev /ebs
2627
USER app
2728

0 commit comments

Comments
 (0)