diff options
| author | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-05 00:10:57 +0000 |
|---|---|---|
| committer | supahgreg <supahgreg@users.noreply.github.com> | 2025-10-05 00:13:35 +0000 |
| commit | fc95bae2a6c5e4fea5a63bd159462df172e9ed53 (patch) | |
| tree | e9691732427333f447542825d160194e2598cc4c /.github/workflows | |
| parent | c3f3eb8387be192a65d492305f02ad0ed1a9403e (diff) | |
Add a Publish workflow.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/php-code-quality.yml | 9 | ||||
| -rw-r--r-- | .github/workflows/publish.yml | 66 |
2 files changed, 73 insertions, 2 deletions
diff --git a/.github/workflows/php-code-quality.yml b/.github/workflows/php-code-quality.yml index 9f599eed5..69d827120 100644 --- a/.github/workflows/php-code-quality.yml +++ b/.github/workflows/php-code-quality.yml @@ -15,20 +15,25 @@ on: - 'phpunit.xml' # Allow manual triggering workflow_dispatch: + # Allow other workflows (e.g. Publish) to invoke this one. + workflow_call: + env: fail-fast: true + permissions: contents: read + jobs: phpstan: name: PHPStan runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Check out code uses: actions/checkout@v5 - name: Set up PHP @@ -55,7 +60,7 @@ jobs: experimental: true steps: - - name: Checkout code + - name: Check out code uses: actions/checkout@v5 - name: Set up PHP ${{ matrix.php }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..8c59ae75e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,66 @@ +name: Publish + +on: + push: + branches: [main] + # Allow manual triggering + workflow_dispatch: + + +permissions: + contents: read + + +jobs: + test-php: + uses: ./.github/workflows/php-code-quality.yml + + publish-dockerhub: + name: Publish ${{ matrix.image.name }} to Docker Hub + needs: + - test-php + runs-on: ubuntu-latest + strategy: + matrix: + image: + - name: app + dockerfile: ./.docker/app/Dockerfile + repository: supahgreg/tt-rss + # - name: web-nginx + # dockerfile: ./.docker/web-nginx/Dockerfile + # repository: supahgreg/tt-rss-web-nginx + + steps: + - name: Check out code + uses: actions/checkout@v5 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ matrix.image.repository }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push to Docker Hub + id: push + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ matrix.image.dockerfile }} + platforms: linux/arm64,linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + provenance: true + sbom: true + push: true |