diff --git a/.devcontainer/BUILD.bazel b/.devcontainer/BUILD.bazel index af531e0..d03eb37 100644 --- a/.devcontainer/BUILD.bazel +++ b/.devcontainer/BUILD.bazel @@ -6,5 +6,5 @@ container_push( image = "@dev-container//image:dockerfile_image.tar", registry = "docker.pkg.github.com", repository = "roleypoly/roleypoly/dev-container", - tag = "{STABLE_GIT_BRANCH}" if "{STABLE_GIT_BRANCH}" != "main" else "latest", + tag = "{STABLE_GIT_BRANCH}", ) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5053c1c..c09365f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,11 +57,3 @@ jobs: with: name: manifest.json path: manifest.json - - - name: Publish Dev Container Image - if: github.ref == 'refs/heads/main' - run: | - "${GITHUB_WORKSPACE}/bin/bazel" run \ - --stamp \ - --workspace_status_command hack/workspace_status.sh\ - //.devcontainer:publish-dev-container diff --git a/.github/workflows/dev-container.yml b/.github/workflows/dev-container.yml new file mode 100644 index 0000000..68a6a90 --- /dev/null +++ b/.github/workflows/dev-container.yml @@ -0,0 +1,34 @@ +name: Build Dev Container + +on: + push: + paths: + - .devcontainer/Dockerfile + schedule: + - cron: "0 12 * * 2" # 12 noon every tuesday + +jobs: + dev_container_build: + name: Bazel Build (Dev Container) + runs-on: ubuntu-latest + 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: Build & Publish Dev Container + run: | + "${GITHUB_WORKSPACE}/bin/bazel" run \ + --stamp \ + --workspace_status_command hack/workspace_status.sh\ + //.devcontainer:publish-dev-container \ No newline at end of file