chore(ci): modify CI/CD process #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
name: CI | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: alpine:edge # go1.18 needs > alpine 3.15 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: add dependencies | |
run: apk add go git | |
- name: install ctags | |
run: ./install-ctags-alpine.sh | |
- name: test | |
run: go test ./... | |
shellcheck: | |
name: shellcheck | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@1.1.0 | |
# We build a shared docker image called "zoekt". This is not pushed, but is | |
# used for creating the indexserver and webserver images. | |
docker: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: | |
- "test" | |
- "shellcheck" | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
# This is the same tag we used for zoekt in the infrastructure repo. | |
- name: version | |
id: version | |
run: .github/workflows/docker-version.sh | |
- name: build-zoekt | |
uses: docker/build-push-action@v1 | |
with: | |
repository: zoekt | |
tags: "latest" | |
add_git_labels: "true" | |
push: "false" | |
build_args: VERSION=${{ steps.version.outputs.value }} | |
- name: build-push-webserver | |
uses: docker/build-push-action@v1 | |
with: | |
repository: sourcegraph/zoekt-webserver | |
tags: ${{ steps.version.outputs.value }},latest | |
dockerfile: Dockerfile.webserver | |
add_git_labels: "true" | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: build-push-indexserver | |
uses: docker/build-push-action@v1 | |
with: | |
repository: sourcegraph/zoekt-indexserver | |
tags: ${{ steps.version.outputs.value }},latest | |
dockerfile: Dockerfile.indexserver | |
add_git_labels: "true" | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} |