mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
chore: start CI/CD
This commit is contained in:
parent
a98ac909c7
commit
dfbcd0c6e6
4 changed files with 66 additions and 27 deletions
33
.github/workflows/build.yml
vendored
Normal file
33
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: Bazel Build
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
bazel_build:
|
||||
name: Bazel Build
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Mount bazel cache
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel
|
||||
|
||||
- name: Install bazelisk
|
||||
run: |
|
||||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
|
||||
mkdir -p "${GITHUB_WORKSPACE}/bin/"
|
||||
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
|
||||
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
"${GITHUB_WORKSPACE}/bin/bazel" test //src/...
|
||||
|
||||
- name: Publish Artifacts
|
||||
run: |
|
||||
"${GITHUB_WORKSPACE}/bin/bazel" query //src/... |\
|
||||
grep +publish |\
|
||||
xargs -l1 "${GITHUB_WORKSPACE}/bin/bazel" run
|
|
@ -1,5 +1,6 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
|
||||
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
||||
|
||||
go_library(
|
||||
name = "discord-bot_lib",
|
||||
|
@ -30,3 +31,21 @@ go_image(
|
|||
embed = [":discord-bot_lib"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
container_push(
|
||||
name = "+publish",
|
||||
format = "Docker",
|
||||
image = ":image",
|
||||
registry = "docker.io",
|
||||
repository = "roleypoly/discord-bot",
|
||||
tag = "dev2",
|
||||
)
|
||||
|
||||
container_push(
|
||||
name = "+publish-2",
|
||||
format = "Docker",
|
||||
image = ":image",
|
||||
registry = "docker.io",
|
||||
repository = "roleypoly/discord-bot",
|
||||
tag = "dev",
|
||||
)
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "gripkit",
|
||||
srcs = [
|
||||
"gripkit.go",
|
||||
"options.go",
|
||||
],
|
||||
importpath = "github.com/roleypoly/roleypoly/src/gripkit",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@com_github_improbable_eng_grpc_web//go/grpcweb",
|
||||
"@io_k8s_klog//:klog",
|
||||
"@org_golang_google_grpc//:go_default_library",
|
||||
],
|
||||
)
|
||||
# go_library(
|
||||
# name = "gripkit",
|
||||
# srcs = [
|
||||
# "gripkit.go",
|
||||
# "options.go",
|
||||
# ],
|
||||
# importpath = "github.com/roleypoly/roleypoly/src/gripkit",
|
||||
# visibility = ["//visibility:public"],
|
||||
# deps = [
|
||||
# "@com_github_improbable_eng_grpc_web//go/grpcweb",
|
||||
# "@io_k8s_klog//:klog",
|
||||
# "@org_golang_google_grpc//:go_default_library",
|
||||
# ],
|
||||
# )
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
name = "jstest",
|
||||
srcs = glob(["*.ts"]),
|
||||
deps = [
|
||||
# "//path/to/other:library"
|
||||
],
|
||||
)
|
Loading…
Add table
Reference in a new issue