-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.3 KB
/
.earthly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
on:
workflow_call:
inputs:
build-dir:
required: true
type: string
env:
FORCE_COLOR: 1
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Put back the git branch into git (Earthly uses it for tagging)
shell: bash
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
shell: bash
run: docker login --username "${DOCKERHUB_USERNAME}" --password "${DOCKERHUB_PASSWORD}"
- name: Install Deps
shell: bash
run: |
sudo apt update -y
sudo apt install curl jq qemu binfmt-support qemu-user-static -y
- name: Install Earthly
shell: bash
run: |
sudo curl -fsSL $(curl -fsSL https://api.github.com/repos/earthly/earthly/releases/latest | jq -r '.assets[].browser_download_url' | grep earthly-linux-amd64) > /usr/local/bin/earthly
sudo chmod +x /usr/local/bin/earthly
- name: Earthly Build
working-directory: ${{ inputs.build-dir }}
run: earthly --allow-privileged --push +all