Skip to content

Commit

Permalink
Add CI workflow for automated build and testing with Earthly
Browse files Browse the repository at this point in the history
  • Loading branch information
timwu-ipevo committed Dec 2, 2024
1 parent 92b1ce3 commit ab69248
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and test with Earthly
uses: earthly/earthly-action@v1
with:
args: +test

- name: Build and save Docker image
uses: earthly/earthly-action@v1
with:
args: +buil
3 changes: 2 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ build:
EXPOSE 8000
ENTRYPOINT ["python"]
CMD ["notes_app.py"]
SAVE IMAGE notes-app:latest
SAVE IMAGE notes-app:latest
d

0 comments on commit ab69248

Please sign in to comment.