Try to fix the image build #232
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: | |
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 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build docker image | |
run: | | |
docker build -t "ghcr.io/nelhage/llama:$GITHUB_SHA" . | |
- name: Push docker image | |
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" |