container.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration
  2. # for details.
  3. name: Build development container
  4. on:
  5. schedule:
  6. - cron: '0 2 * * *'
  7. push:
  8. branches:
  9. - develop
  10. pull_request:
  11. branches:
  12. - develop
  13. jobs:
  14. Earthly:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Set up Earthly
  18. uses: earthly/actions-setup@v1
  19. with:
  20. version: 'latest' # or pin to an specific version, e.g. "v0.6.10"
  21. - name: Log Earthly version
  22. run: earthly --version
  23. - name: Authenticate to GitHub Container Registry
  24. if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
  25. env:
  26. GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
  27. run: echo "${{ secrets.GH_CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
  28. - name: Set up QEMU
  29. uses: docker/setup-qemu-action@v3
  30. with:
  31. image: tonistiigi/binfmt:latest
  32. platforms: all
  33. - name: Checkout repo
  34. uses: actions/checkout@v4
  35. with:
  36. fetch-depth: 0
  37. - name: Build and push
  38. if: ${{ github.event_name == 'schedule' && env.GH_CR_PAT != null }}
  39. env:
  40. GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
  41. EARTHLY_BUILD_TAG: 'nightly'
  42. EARTHLY_BUILD_BRANCH: 'develop'
  43. EARTHLY_PUSH: true
  44. uses: nick-fields/retry@v2
  45. with:
  46. timeout_minutes: 20
  47. max_attempts: 3
  48. command: ./build/develop/container.sh