Skip to content

Add GH Action for build workflow #4

Add GH Action for build workflow

Add GH Action for build workflow #4

Workflow file for this run

name: Build Nginx for Heroku Stacks
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target: [heroku-20, heroku-22, heroku-24]
arch: [amd64, arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Run Makefile target
run: |
if [[ "${{ matrix.target }}" == "heroku-24" ]]; then
make build-${{ matrix.target }}-${{ matrix.arch }}
else
make build-${{ matrix.target }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: |
${{ matrix.target }}${{ (matrix.target == 'heroku-24' && '-' || '') }}${{ matrix.arch }}.tgz
path: |
nginx-${{ matrix.target }}${{ (matrix.target == 'heroku-24' && '-' || '') }}${{ matrix.arch }}.tgz
commit:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
- 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"
mkdir -p builds/
mv *.tgz builds/
git add builds/*.tgz
git commit -m "Add nginx builds for Heroku stacks on multiple architectures"
git push