| name: images |
| |
| on: |
| pull_request: |
| push: |
| branches: |
| - main |
| |
| permissions: |
| packages: write |
| contents: read |
| |
| jobs: |
| build: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout project |
| uses: actions/checkout@v4 |
| |
| - name: Install Earthly |
| uses: earthly/actions-setup@v1 |
| with: |
| github-token: ${{ secrets.GITHUB_TOKEN }} |
| |
| - name: Configure Earthly |
| run: | |
| mkdir -p ~/.earthly/certs |
| cat << EOF > ~/.earthly/certs/ca_cert.pem |
| ${{ secrets.EARTHLY_CA_CERT }} |
| EOF |
| cat << EOF > ~/.earthly/certs/earthly_cert.pem |
| ${{ secrets.EARTHLY_CERT }} |
| EOF |
| cat << EOF > ~/.earthly/certs/earthly_key.pem |
| ${{ secrets.EARTHLY_CERT_KEY }} |
| EOF |
| cat << EOF > ~/.earthly/config.yml |
| global: |
| buildkit_host: tcp://162.253.55.125:8372 |
| EOF |
| |
| - name: Login to GitHub Container Registry |
| uses: docker/login-action@v3 |
| with: |
| registry: ghcr.io |
| username: ${{ github.actor }} |
| password: ${{ secrets.GITHUB_TOKEN }} |
| |
| - name: Build images |
| run: earthly +images |
| env: |
| EARTHLY_CI: true |
| EARTHLY_PUSH: "${{ github.event_name == 'push' }}" |