Skip to content

Commit

Permalink
Add docker build and release support (#165)
Browse files Browse the repository at this point in the history
* Add docker

* Fix frontend build

* Add release pipeline
  • Loading branch information
imWildCat authored Mar 5, 2022
1 parent f50bc49 commit a19f2cf
Show file tree
Hide file tree
Showing 7 changed files with 2,526 additions and 2,356 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
39 changes: 39 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# Source: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images

name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: wildcat/scylla

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ out/
# node
node_modules

.parcel-cache

*.bak

package-lock.json
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:lts-buster as node-build
WORKDIR /root
COPY package.json .
RUN npm install
RUN yarn install
COPY . .
RUN make assets-build

Expand All @@ -24,8 +24,6 @@ LABEL maintainer="WildCat <[email protected]>"

RUN apt-get update && apt-get install -y libxslt-dev libssl-dev libcurl4-openssl-dev

RUN apt-get install -y libgbm-dev gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

COPY --from=python-build /usr/local/lib/python3.9/site-packages/ /usr/local/lib/python3.9/site-packages/
COPY --from=python-build /root/.cache/ms-playwright /root/.cache/ms-playwright

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"start": "parcel serve frontend/src/index.html",
"build": "cross-env NODE_ENV=production parcel build src/index.html --public-url .",
"build": "cross-env NODE_ENV=production parcel build frontend/src/index.html --public-url .",
"watch": "parcel watch src/index.html",
"predeploy": "npm run build",
"test": "null"
Expand All @@ -36,20 +36,20 @@
"@types/react-virtualized": "^9.18.3",
"cross-env": "^5.1.4",
"parcel-bundler": "^1.12.3",
"typescript": "^2.8.3"
"typescript": "^2.8.3",
"sass": "^1.49.9"
},
"dependencies": {
"axios": "^0.21.1",
"milligram": "^1.3.0",
"ml": "^3.2.0",
"moment": "^2.22.1",
"node-sass": "^7.0.0",
"query-string": "^6.1.0",
"react": "^15.3.0 || ^16.0.0-alpha",
"react": "^16.0.0",
"react-dom": "^16.3.3",
"react-router-dom": "^4.2.2",
"react-simple-maps": "^0.12.1",
"react-tooltip": "^3.10.0",
"react-virtualized": "^9.19.0"
}
}
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tornado==5.1.1
peewee==3.14.4
requests==2.26.0
pycurl==7.44.0
pycurl==7.44.1
sanic==21.6.2
sanic-cors
schedule==1.1.0
Expand Down
Loading

0 comments on commit a19f2cf

Please sign in to comment.