Skip to content

Commit ca3d4da

Browse files
authored
Add a workflow to build docker image (#202)
1 parent fc271d6 commit ca3d4da

File tree

6 files changed

+1098
-944
lines changed

6 files changed

+1098
-944
lines changed

.github/workflows/pipeline.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,37 @@ jobs:
2424
- uses: actions/setup-node@v3
2525
with:
2626
node-version: 18
27-
# TODO build:web fails currently, but it'd be good to make that work when possible and then add it here.
2827
- run: yarn
2928
- run: yarn build:jsonschema
3029
- run: yarn build:ts
30+
31+
build-docker:
32+
name: Build Docker Image
33+
runs-on: ubuntu-latest
34+
env:
35+
# Only push if this is develop, otherwise we just want to build
36+
# On a PR github.ref is the target branch, so don't push for that either
37+
PUSH: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
38+
39+
steps:
40+
- name: Check out
41+
uses: actions/checkout@v2
42+
43+
- name: Login to GHCR
44+
uses: docker/login-action@v3
45+
if: ${{ env.PUSH == 'true' }}
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build image
52+
uses: docker/build-push-action@v2
53+
with:
54+
context: .
55+
file: ./Dockerfile
56+
platforms: ${{ env.PLATFORMS }}
57+
push: ${{ env.PUSH }}
58+
tags: |
59+
ghcr.io/matrix-org/conference-bot:latest
60+
ghcr.io/matrix-org/conference-bot:${{ github.sha }}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"moment": "^2.29.4",
3939
"node-fetch": "^2.6.1",
4040
"pg": "^8.9.0",
41+
"postcss-preset-env": "^6.7.0",
42+
"querystring-es3": "^0.2.1",
4143
"prom-client": "^15.0.0",
4244
"qs": "^6.11.2",
4345
"rfc4648": "^1.4.0",

src/web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
import { Response, Request } from "express";
1818
import template from "./utils/template"
1919
import config from "./config";
20-
import { base32 } from "rfc4648";
20+
const { base32 } = require('rfc4648');
2121
import { LogService, MatrixClient } from "matrix-bot-sdk";
2222
import { sha256 } from "./utils";
2323
import * as dns from "dns";

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"experimentalDecorators": true,
55
"emitDecoratorMetadata": true,
6+
"lib": ["DOM", "es2022"],
67
"noImplicitAny": false,
78
"strict": true,
89
"strictPropertyInitialization": false,

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module.exports = {
5050
},
5151
resolve: {
5252
extensions: ['.ts', '.js'],
53+
fallback: { "querystring": require.resolve("querystring-es3") }
5354
},
5455
plugins: [
5556
new CleanWebpackPlugin({ cleanStaleWebpackAssets: false }),

0 commit comments

Comments
 (0)