Create Dockerfile #2
This file contains hidden or 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 apps | ||
|
Check failure on line 1 in .github/workflows/apps.yml
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_run: | ||
| workflows: [build base] | ||
| types: [completed] | ||
| branches: | ||
| - master | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - apps/** | ||
| - scripts/apps/** | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| jobs: | ||
| check_changes: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| postgresql_changed: ${{ steps.filter.outputs.postgresql_changed || 'false' }} | ||
| uptime_kuma_2_changed: ${{ steps.filter.outputs.uptime_kuma_2_changed || 'false' }} | ||
| base_changed: ${{ steps.filter.outputs.base_changed || 'false' }} | ||
| steps: | ||
| - if: ${{ github.event_name == 'push' }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - if: ${{ github.event_name == 'push' }} | ||
| id: filter | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| postgresql_changed: | ||
| - 'apps/postgresql/**' | ||
| - 'scripts/apps/postgresql/**' | ||
| uptime_kuma_2_changed: | ||
| - 'apps/uptime-kuma-2/**' | ||
| - 'scripts/apps/uptime-kuma-2/**' | ||
| base_changed: | ||
| - 'base/**' | ||
| - 'scripts/base/ampstart.sh' | ||
| build_and_push: | ||
| needs: [check_changes] | ||
| if: ${{ github.repository_owner == 'CubeCoders' && github.ref == 'refs/heads/master' && ((github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && needs.check_changes.outputs.base_changed != 'true' && ((matrix.app == 'postgresql' && needs.check_changes.outputs.postgresql_changed == 'true') || (matrix.app == 'uptime-kuma-2' && needs.check_changes.outputs.uptime_kuma_2_changed == 'true'))) }} | ||
| name: 'amp:apps-${{ matrix.app }}' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| app: | ||
| - postgresql | ||
| - uptime-kuma-2 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.sha }} | ||
| - uses: docker/setup-qemu-action@v3 | ||
| - uses: docker/setup-buildx-action@v3 | ||
| - uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ vars.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./apps/${{ matrix.app }}/Dockerfile | ||
| platforms: linux/amd64,linux/arm64/v8 | ||
| push: true | ||
| pull: true | ||
| tags: cubecoders/ampbase:${{ matrix.app }} | ||
| cache-from: type=gha,scope=${{ github.workflow }}-${{ matrix.app }} | ||
| cache-to: type=gha,mode=max,scope=${{ github.workflow }}-${{ matrix.app }} | ||
| provenance: mode=max | ||
| sbom: true | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: false | ||