Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
if: ${{ (github.ref == 'refs/heads/amogus' || github.ref == 'refs/heads/sus') && steps.lint.outcome == 'success' }}
if: ${{ steps.lint.outcome == 'success' }}
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/0d9e-tech/web:${{ github.ref == 'refs/heads/amogus' && 'staging' || 'latest' }}
tags: ghcr.io/0d9e-tech/web:${{ github.ref == 'refs/heads/sus' && 'latest' || github.ref == 'refs/heads/amogus' && 'staging' || 'dev' }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
ACTOR=${{ github.actor }}

- name: Deploy
if: ${{ (github.ref == 'refs/heads/amogus' || github.ref == 'refs/heads/sus') && steps.lint.outcome == 'success' }}
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ RUN deno cache src/server.deno.ts
COPY static static
COPY --from=blog-builder /srv/jekyll/build/ ./static/blog

ENV PATH "$PATH:/usr/games"
ENV PATH="$PATH:/usr/games"
COPY ./static/amogus.cow /usr/share/cowsay/cows

ARG ACTOR
RUN sed -i "s|<BUILD_ACTOR>|${ACTOR}|g" src/tg/init.deno.ts

CMD ["sh", "-c", "deno run --unstable-cron --allow-all src/server.deno.ts 2>&1 | sed -u -e \"s/$TG_BOT_TOKEN/<REDACTED>/g\" >> static/persistent/log.txt"]
19 changes: 19 additions & 0 deletions src/tg/init.deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ export function checkStickerReaction(stickerMessageId: number) {

const hashOrigins = [{ lat: 50.1005803, lon: 14.3954325 }];

const users: Record<string, string> = {
mvolfik: "Matěj",
chamik: "Kubík",
CloudMracek: "Honza",
marekmaskarinec: "Marek",
mariansam: "Marain",
Matuush: "Matúš",
ProkopRandacek: "Prokop",
WIPocket: "Adam",
topberry: "Honzak",
Ouolim: "Janek",
};

async function postGeohash() {
const upcoming = new Date();
upcoming.setHours(6);
Expand Down Expand Up @@ -242,6 +255,12 @@ export async function init() {
);

setTimeout(async () => {
const username = '<BUILD_ACTOR>';
const name = users[username] ?? "Nějakej impostor";
await tgCall({
chat_id: MAIN_CHAT_ID,
text: `${name} zase kazí všechnu zábavu`,
});
await tgCall(
{
photo: `https://${DOMAIN}/startup.jpg?q=${bootId}`,
Expand Down
Loading