Skip to content

Commit

Permalink
Add a workflow to build docker image (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay authored Dec 6, 2023
1 parent fc271d6 commit ca3d4da
Show file tree
Hide file tree
Showing 6 changed files with 1,098 additions and 944 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,37 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
# TODO build:web fails currently, but it'd be good to make that work when possible and then add it here.
- run: yarn
- run: yarn build:jsonschema
- run: yarn build:ts

build-docker:
name: Build Docker Image
runs-on: ubuntu-latest
env:
# Only push if this is develop, otherwise we just want to build
# On a PR github.ref is the target branch, so don't push for that either
PUSH: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}

steps:
- name: Check out
uses: actions/checkout@v2

- name: Login to GHCR
uses: docker/login-action@v3
if: ${{ env.PUSH == 'true' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: ${{ env.PUSH }}
tags: |
ghcr.io/matrix-org/conference-bot:latest
ghcr.io/matrix-org/conference-bot:${{ github.sha }}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"moment": "^2.29.4",
"node-fetch": "^2.6.1",
"pg": "^8.9.0",
"postcss-preset-env": "^6.7.0",
"querystring-es3": "^0.2.1",
"prom-client": "^15.0.0",
"qs": "^6.11.2",
"rfc4648": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import { Response, Request } from "express";
import template from "./utils/template"
import config from "./config";
import { base32 } from "rfc4648";
const { base32 } = require('rfc4648');
import { LogService, MatrixClient } from "matrix-bot-sdk";
import { sha256 } from "./utils";
import * as dns from "dns";
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": ["DOM", "es2022"],
"noImplicitAny": false,
"strict": true,
"strictPropertyInitialization": false,
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
},
resolve: {
extensions: ['.ts', '.js'],
fallback: { "querystring": require.resolve("querystring-es3") }
},
plugins: [
new CleanWebpackPlugin({ cleanStaleWebpackAssets: false }),
Expand Down
Loading

0 comments on commit ca3d4da

Please sign in to comment.