Enable API support and replace placeholder variables with environment… #60
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
name: Build & Push Octane with PDNS | |
on: | |
push: | |
branches: | |
- 'main' | |
env: | |
ORG_NAME: lostlink | |
APP_NAME: octane-pdns | |
jobs: | |
should_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Detect File Changes | |
uses: trilom/[email protected] | |
- name: Changed Files List | |
run: | | |
jq -r '.[]' $HOME/files.json | |
- name: Filter and set Build Status | |
id: build | |
run: | | |
unique_entries=$(jq -r '.[] | select(test("octane-pdns"))' $HOME/files.json | awk -v RS=' ' '!a[$1]++') | |
if [[ ! -z "$unique_entries" ]] | |
then | |
status="deploy" | |
else | |
status="skip" | |
fi | |
echo "status=$status" >> $GITHUB_OUTPUT | |
outputs: | |
status: ${{ steps.build.outputs.status }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: should_deploy | |
if: needs.should_deploy.outputs.status == 'deploy' | |
strategy: | |
fail-fast: false | |
matrix: | |
build: | |
- {tag: "8.2-cli-buster", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.2-cli-bullseye", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.2-cli-bookworm", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.2.12-cli-bullseye", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.2.12-cli-bookworm", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.3-cli-bullseye", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "8.3-cli-bookworm", platforms: "linux/arm64,linux/amd64"} | |
- {tag: "latest", platforms: "linux/arm64,linux/amd64"} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Import environment variables from a file | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: "docker.env" | |
expand: "true" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: "{{defaultContext}}:${{ env.APP_NAME }}" | |
platforms: ${{ matrix.build.platforms }} | |
push: true | |
tags: ${{ env.ORG_NAME }}/${{ env.APP_NAME }}:${{ matrix.build.tag }} | |
build-args: | | |
"PHP_TAG=${{ matrix.build.tag }}" | |
"NODE_VERSION=${{ env.NODE_VERSION }}" | |
"TIMEZONE=${{ env.TIMEZONE }}" | |
"WWWUSER=${{ env.WWWUSER }}" | |
"WWWGROUP=${{ env.WWWGROUP }}" | |
"ENABLE_HORIZON=${{ env.ENABLE_HORIZON }}" | |
"ENABLE_SCHEDULER=${{ env.ENABLE_SCHEDULER }}" | |
"ENABLE_VECTOR=${{ env.ENABLE_VECTOR }}" | |
"ENABLE_PDNS=${{ env.ENABLE_PDNS }}" | |
"INCLUDE_NPM=${{ env.INCLUDE_NPM }}" | |
"INSTALL_OPCACHE=${{ env.INSTALL_OPCACHE }}" | |
"INSTALL_PHPREDIS=${{ env.INSTALL_PHPREDIS }}" | |
"INSTALL_PCNTL=${{ env.INSTALL_PCNTL }}" | |
"INSTALL_BCMATH=${{ env.INSTALL_BCMATH }}" | |
"INSTALL_RDKAFKA=${{ env.INSTALL_RDKAFKA }}" | |
"INSTALL_SWOOLE=${{ env.INSTALL_SWOOLE }}" | |
"SWOOLE_SERVER=${{ env.SWOOLE_SERVER }}" | |
"INSTALL_INTL=${{ env.INSTALL_INTL }}" | |
"INSTALL_MEMCACHED=${{ env.INSTALL_MEMCACHED }}" | |
"INSTALL_MYSQL_CLIENT=${{ env.INSTALL_MYSQL_CLIENT }}" | |
"INSTALL_PDO_PGSQL=${{ env.INSTALL_PDO_PGSQL }}" | |
"INSTALL_PGSQL=${{ env.INSTALL_PGSQL }}" | |
"INSTALL_PG_CLIENT=${{ env.INSTALL_PG_CLIENT }}" | |
"INSTALL_POSTGIS=${{ env.INSTALL_POSTGIS }}" | |
"INSTALL_EXCIMER=${{ env.INSTALL_EXCIMER }}" |