Skip to content

Merge pull request #68 from EvanKrall/patch-1 #230

Merge pull request #68 from EvanKrall/patch-1

Merge pull request #68 from EvanKrall/patch-1 #230

Workflow file for this run

on:
pull_request: {}
push: {}
name: Continuous integration
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.16'
- name: go build
run: |
go build ./...
- name: go install
run: |
GOBIN=$(pwd)/install go install ./...
- name: go test
run: |
PATH=$PATH:$(pwd)/install go test -tags llama.runtime ./...
- name: Check license headers
run: |
./scripts/dev/check-license
build-image:
runs-on: ubuntu-latest
env:
GHCR_TOKEN: ${{secrets.GHCR_TOKEN}}
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
if: env.GHCR_TOKEN
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build docker image
run: |
docker build -t "ghcr.io/nelhage/llama:$GITHUB_SHA" .
- name: Push docker image
if: env.GHCR_TOKEN
run: |
docker push "ghcr.io/nelhage/llama:$GITHUB_SHA"
- name: Tag "latest" docker container
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
run: |
docker tag "ghcr.io/nelhage/llama:$GITHUB_SHA" "ghcr.io/nelhage/llama:latest"
docker push "ghcr.io/nelhage/llama:latest"