forked from agrberg/heroku-buildpack-nginx-geoip2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fe77f2
commit ee37805
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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" || "${{ matrix.arch }}" == "amd64" || "${{ matrix.arch }}" == "arm64" ]]; then | ||
make ${{ 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 |