Skip to content

Commit

Permalink
feat: improve ci, reduce build time
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Sep 4, 2024
1 parent f87e41a commit 22bf94d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 104 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ci
env:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.14
- uses: actions/checkout@v2
- name: Docker Login
run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- name: Run build
run: earthly --ci +ci

test:
runs-on: ubuntu-latest
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.14
- uses: actions/checkout@v2
- name: Docker Login
run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- name: Run build
run: earthly -P --ci +test

build-prod:
runs-on: ubuntu-latest
needs: test
if: success() && github.ref == 'refs/heads/main'
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.14
- uses: actions/checkout@v2
- name: Docker Login
run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- name: Run build
run: earthly -P --ci --push --build-arg GITHUB_REPO=${{ github.repository }} +docker

34 changes: 0 additions & 34 deletions .github/workflows/docker.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/lint.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# PEA Pescarte

[![lint](https://github.com/peapescarte/pescarte-api/actions/workflows/lint.yml/badge.svg)](https://github.com/peapescarte/pescarte-api/actions/workflows/lint.yml)
[![test](https://github.com/peapescarte/pescarte-api/actions/workflows/test.yml/badge.svg)](https://github.com/peapescarte/pescarte-api/actions/workflows/test.yml)
[![ci](https://github.com/peapescarte/pescarte-plataforma/actions/workflows/ci.yml/badge.svg)](https://github.com/peapescarte/pescarte-plataforma/actions/workflows/ci.yml)

------------------------------------------------------------------------

Expand Down

0 comments on commit 22bf94d

Please sign in to comment.