Skip to content

Split build jobs

Split build jobs #16

Workflow file for this run

name: Build Nginx for Heroku Stacks
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build20-22:
runs-on: ubuntu-latest
strategy:
matrix:
target: [heroku-20, heroku-22]
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run Makefile target
run: |
make build-${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: |
${{ matrix.target }}.tgz
path: .
build24:
runs-on: ubuntu-latest
strategy:
matrix:
target: [heroku-24]
arch: [amd64, arm64]
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run Makefile target
run: |
make build-${{ matrix.target }}-${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: |
${{ matrix.target }}'-'${{ matrix.arch }}.tgz
path: .
commit:
runs-on: ubuntu-latest
needs: [build24, build20-22]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download build artifacts
run: ls -R
- uses: actions/download-artifact@v4
with:
path: .
- name: Commit and push artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add *.tgz
git commit -m "Add nginx builds for Heroku stacks on multiple architectures"
git push