2023-01-05 01:15:12 +03:00
|
|
|
# See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration
|
|
|
|
# for details.
|
|
|
|
|
|
|
|
name: Build development container
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * *'
|
|
|
|
push:
|
|
|
|
branches:
|
2023-01-28 03:18:02 +03:00
|
|
|
- develop
|
2023-01-05 01:15:12 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-01-28 03:18:02 +03:00
|
|
|
- develop
|
2023-01-05 01:15:12 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
Earthly:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up Earthly
|
|
|
|
uses: earthly/actions-setup@v1
|
|
|
|
with:
|
|
|
|
version: 'latest' # or pin to an specific version, e.g. "v0.6.10"
|
|
|
|
|
|
|
|
- name: Log Earthly version
|
|
|
|
run: earthly --version
|
|
|
|
|
|
|
|
- name: Authenticate to GitHub Container Registry
|
|
|
|
if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
|
|
|
|
env:
|
|
|
|
GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
|
|
|
|
run: echo "${{ secrets.GH_CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
2023-10-08 00:56:58 +03:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2023-01-05 01:15:12 +03:00
|
|
|
with:
|
|
|
|
image: tonistiigi/binfmt:latest
|
|
|
|
platforms: all
|
|
|
|
|
2024-09-05 23:50:59 +03:00
|
|
|
- name: Check out pull request code
|
2023-10-07 23:52:25 +03:00
|
|
|
uses: actions/checkout@v4
|
2024-09-05 23:50:59 +03:00
|
|
|
if: github.event_name == 'pull_request'
|
2023-01-05 01:15:12 +03:00
|
|
|
with:
|
2024-09-05 23:50:59 +03:00
|
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
|
|
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4
|
2024-11-09 00:16:13 +03:00
|
|
|
if: github.event_name == 'push' || github.event_name == 'schedule'
|
2023-01-05 01:15:12 +03:00
|
|
|
|
2023-01-27 03:24:00 +03:00
|
|
|
- name: Build and push
|
|
|
|
if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
|
2023-01-31 10:33:59 +03:00
|
|
|
env:
|
|
|
|
GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
|
|
|
|
EARTHLY_BUILD_TAG: 'nightly'
|
|
|
|
EARTHLY_BUILD_BRANCH: 'develop'
|
|
|
|
EARTHLY_PUSH: true
|
2024-04-10 04:23:40 +03:00
|
|
|
uses: nick-fields/retry@v3
|
2023-01-27 03:24:00 +03:00
|
|
|
with:
|
2023-02-03 09:13:25 +03:00
|
|
|
timeout_minutes: 20
|
2023-01-27 03:24:00 +03:00
|
|
|
max_attempts: 3
|
|
|
|
command: ./build/develop/container.sh
|