38 lines
977 B
YAML
38 lines
977 B
YAML
|
# .github/workflows/ci.yml
|
||
|
|
||
|
name: CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [main]
|
||
|
pull_request:
|
||
|
branches: [main]
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
env:
|
||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||
|
FORCE_COLOR: 1
|
||
|
steps:
|
||
|
- uses: earthly/actions/setup-earthly@v1
|
||
|
with:
|
||
|
version: v0.7.0
|
||
|
- uses: actions/checkout@v2
|
||
|
- name: Put back the git branch into git (Earthly uses it for tagging)
|
||
|
run: |
|
||
|
branch=""
|
||
|
if [ -n "$GITHUB_HEAD_REF" ]; then
|
||
|
branch="$GITHUB_HEAD_REF"
|
||
|
else
|
||
|
branch="${GITHUB_REF##*/}"
|
||
|
fi
|
||
|
git checkout -b "$branch" || true
|
||
|
- name: Docker Login
|
||
|
run: docker login docker.hibas123.de --username "$DOCKER_USERNAME" --password "$DOCKER_TOKEN"
|
||
|
- name: Earthly version
|
||
|
run: earthly --version
|
||
|
- name: Run build
|
||
|
run: earthly --push +docker-multi
|