blob: d1ab65d367959d9905383aaf2352d4d033a2bee3 [file] [log] [blame]
Mohammed Nasere81021f2024-01-01 22:49:30 -05001name: images
2
3on:
4 pull_request:
5 push:
6 branches:
7 - main
8
9jobs:
10 build:
11 runs-on: ubuntu-latest
12 steps:
13 - name: Checkout project
14 uses: actions/checkout@v4
15
16 - name: Install Earthly
17 uses: earthly/actions-setup@v1
18 with:
19 github-token: ${{ secrets.GITHUB_TOKEN }}
20
21 - name: Configure Earthly
22 run: |
23 mkdir -p ~/.earthly/certs
24 cat << EOF > ~/.earthly/certs/ca_cert.pem
25 ${{ secrets.EARTHLY_CA_CERT }}
26 EOF
27 cat << EOF > ~/.earthly/certs/earthly_cert.pem
28 ${{ secrets.EARTHLY_CERT }}
29 EOF
30 cat << EOF > ~/.earthly/certs/earthly_key.pem
31 ${{ secrets.EARTHLY_CERT_KEY }}
32 EOF
33 cat << EOF > ~/.earthly/config.yml
34 global:
35 buildkit_host: tcp://162.253.55.125:8372
36 EOF
37
38 - name: Login to GitHub Container Registry
39 uses: docker/login-action@v3
40 with:
41 registry: ghcr.io
42 username: ${{ github.actor }}
43 password: ${{ secrets.GITHUB_TOKEN }}
44
45 - name: Build images
46 run: earthly +images
47 env:
48 EARTHLY_CI: true
49 EARTHLY_PUSH: "${{ github.event_name == 'push' }}"