2024-09-19 10:44:54 -04:00
|
|
|
name: GitHub Actions CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: example earthly test
|
|
|
|
runs-on: ubuntu-latest
|
2024-09-19 10:49:35 -04:00
|
|
|
env:
|
|
|
|
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
|
2024-09-19 10:44:54 -04:00
|
|
|
steps:
|
2024-09-19 11:58:43 -04:00
|
|
|
- name: "Install Earthly"
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-09-19 11:59:13 -04:00
|
|
|
sudo apt-get install -y \
|
2024-09-19 11:58:43 -04:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg \
|
|
|
|
lsb-release
|
|
|
|
curl -fsSL https://pkg.earthly.dev/earthly.pgp | sudo gpg --dearmor -o /usr/share/keyrings/earthly-archive-keyring.gpg
|
|
|
|
echo \
|
|
|
|
"deb [arch=amd64 signed-by=/usr/share/keyrings/earthly-archive-keyring.gpg] https://pkg.earthly.dev/deb \
|
|
|
|
stable main" | sudo tee /etc/apt/sources.list.d/earthly.list > /dev/null
|
|
|
|
sudo apt-get update
|
2024-09-19 11:59:13 -04:00
|
|
|
sudo apt-get install -y earthly
|
2024-09-19 10:49:35 -04:00
|
|
|
- uses: actions/checkout@v4
|
2024-09-19 10:44:54 -04:00
|
|
|
- name: Docker login # to avoid dockerhub rate-limiting
|
|
|
|
run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
|
2024-09-19 10:55:05 -04:00
|
|
|
- name: Log into ghcr.io
|
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: xe
|
|
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
2024-09-19 11:48:25 -04:00
|
|
|
- name: use sat alpha
|
2024-09-19 10:51:14 -04:00
|
|
|
run: |
|
|
|
|
earthly org select me-2625
|
|
|
|
earthly sat select alpha
|
2024-09-19 12:02:24 -04:00
|
|
|
docker info
|
2024-09-19 12:05:51 -04:00
|
|
|
env
|
2024-09-19 10:44:54 -04:00
|
|
|
- name: run the earthly hello world
|
2024-09-19 11:32:41 -04:00
|
|
|
run: earthly --verbose github.com/earthly/hello-world:main+hello
|