Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 8524f59

Browse files
author
Stephen Gutekanst
committed
CI: run tests, build Docker images on Linux
Docker cannot be used on macOS runners, apparently, due to licensing constraints between Docker corp. and GitHub corp. Fun. Anyway, we now build the Docker images on a Linux runner. Helps #20 Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
1 parent 2546a4d commit 8524f59

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
brew uninstall go@1.17
2424
brew install go@1.18
2525
task install-frontend-deps
26+
- name: Run tests
27+
run: task test
2628
- name: Cross-compile for every OS
2729
run: task cross-compile
2830
- name: Record latest release version
@@ -39,15 +41,3 @@ jobs:
3941
env:
4042
RELEASE_COMMIT: ${{steps.recorded_release_version.outputs.commit}}
4143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
- name: Publish Docker image
43-
if: success() && github.ref == 'refs/heads/main' && github.event_Name == 'push' && github.repository == 'sourcegraph/doctree'
44-
run: |
45-
brew install --cask docker
46-
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
47-
task build-image
48-
docker tag "sourcegraph/doctree:dev" "sourcegraph/doctree:$RELEASE_COMMIT"
49-
docker push "sourcegraph/doctree:$RELEASE_COMMIT"
50-
env:
51-
RELEASE_COMMIT: ${{steps.recorded_release_version.outputs.commit}}
52-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
53-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/docker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker images
2+
on:
3+
workflow_run:
4+
workflows: ["CI"]
5+
types:
6+
- completed
7+
jobs:
8+
main:
9+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: "1.18"
17+
- name: Install Task
18+
uses: arduino/setup-task@v1
19+
- name: Build Docker image
20+
run: |
21+
task install-frontend-deps
22+
task build-image
23+
- name: Publish Docker image
24+
if: success() && github.ref == 'refs/heads/main' && github.event_Name == 'push' && github.repository == 'sourcegraph/doctree'
25+
run: |
26+
echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin
27+
docker tag "sourcegraph/doctree:dev" "sourcegraph/doctree:$RELEASE_COMMIT"
28+
docker push "sourcegraph/doctree:$RELEASE_COMMIT"
29+
env:
30+
RELEASE_COMMIT: ${{steps.recorded_release_version.outputs.commit}}
31+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
32+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 commit comments

Comments
 (0)