Skip to content

Commit d3e6f36

Browse files
authored
Merge pull request #18 from buggregator/feature/docker-build
Adds docker container build on release
2 parents 662b7a0 + 2301545 commit d3e6f36

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.docker/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Clone the project
2+
FROM alpine/git as git
3+
4+
ARG REPOSITORY=https://github.com/buggregator/frontend
5+
ARG BRANCH=master
6+
RUN git clone -b $BRANCH $REPOSITORY /app
7+
8+
# Build JS files
9+
FROM node:19-alpine as frontend
10+
COPY --from=git /app /app
11+
WORKDIR /app
12+
13+
ENV NODE_OPTIONS=--openssl-legacy-provider
14+
15+
RUN yarn install
16+
RUN npm run generate
17+
RUN rm -rf node_modules
18+
19+
LABEL org.opencontainers.image.source=$REPOSITORY
20+
LABEL org.opencontainers.image.description="Buggregator Frontend"
21+
LABEL org.opencontainers.image.licenses=MIT

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
patreon: butschster

.github/workflows/docker-image.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Docker Image CI
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build-release:
10+
if: "!github.event.release.prerelease"
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: 'Get Previous tag'
17+
id: previoustag
18+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
19+
with:
20+
fallback: v0.1
21+
22+
- name: Login to Docker Hub
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ghcr.io
26+
username: ${{ secrets.GHCR_LOGIN }}
27+
password: ${{ secrets.GHCR_PASSWORD }}
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v2
32+
33+
- name: Build and push
34+
id: docker_build
35+
uses: docker/build-push-action@v3
36+
with:
37+
context: ./
38+
file: ./.docker/Dockerfile
39+
push: true
40+
build-args:
41+
APP_VERSION=${{ steps.previoustag.outputs.tag }}
42+
tags:
43+
ghcr.io/buggregator/frontend:latest, ghcr.io/buggregator/frontend:${{ steps.previoustag.outputs.tag }}

0 commit comments

Comments
 (0)