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