Merge pull request 'Push to the remote registry only on the main branch' (#165) from push-only-main into main
All checks were successful
Playwright Tests / test (push) Has been skipped
Check usage of free licenses / build-static-assets (push) Successful in 35s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m29s

Reviewed-on: #165
This commit is contained in:
bustikiller 2024-12-29 12:22:27 +00:00
commit f8a6f4d245

View File

@ -1,8 +1,6 @@
name: Build Nginx-based docker image
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
@ -30,7 +28,7 @@ jobs:
with:
context: .
target: deps
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps
cache-to: type=inline
@ -40,16 +38,16 @@ jobs:
with:
context: .
target: builder
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder
cache-to: type=inline
- name: Build and push
- name: Build and push (final)
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
cache-to: type=inline