Skip to content

Commit

Permalink
ci: add initial ci stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
KryptosKid committed Dec 30, 2020
1 parent 5152c10 commit 9af58fc
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .ci/pipeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
Job,
pushStep,
} from "https://pkg.buildyboi.ci/buildy/core@latest/mod.ts";
import * as Docker from "https://pkg.buildyboi.ci/buildy/docker@latest/mod.ts";
import { readSecrets } from "https://pkg.buildyboi.ci/buildy/core@latest/secrets.ts";

const image = "rust:1.48-buster";

export async function run(job: Job) {
await Docker.run(
`cargo build --bins --release --target-dir ./target && \
mv target/release/landis /repo/landis`,
{
image: image,
},
);
const tag = `landis/landis:latest`;

pushStep(`Build Landis Image`);
await Docker.buildImage({
tag: tag,
});

pushStep(`Push Landis Image`);
const [githubUsername, githubToken] = await readSecrets(
"GITHUB_USERNAME",
"GITHUB_TOKEN",
);

await Docker.pushImage(
`${tag}`,
"docker.pkg.github.com/uplol",
{
username: githubUsername,
password: githubToken,
},
);
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/mcserver
/out
/out
/.vscode
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:20.04

RUN mkdir -p /app \
&& mkdir -p /app/out \
&& mkdir -p /app/mcserver
WORKDIR /app

COPY palette.tar.gz /app/palette.tar.gz
COPY /web /app/web
COPY /landis /app/landis

RUN chmod +x /app/landis

ENTRYPOINT ["/app/landis"]

0 comments on commit 9af58fc

Please sign in to comment.