2024-09-07 15:57:37 +02:00
|
|
|
name: Build Nginx-based docker image
|
2024-08-11 22:57:03 +02:00
|
|
|
on:
|
|
|
|
push:
|
2024-12-29 16:23:52 +01:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2024-11-03 09:31:10 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2024-08-11 22:57:03 +02:00
|
|
|
jobs:
|
|
|
|
build-static-assets:
|
|
|
|
runs-on: ubuntu-latest
|
2024-11-03 09:40:57 +01:00
|
|
|
timeout-minutes: 30
|
2024-08-11 22:57:03 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
2024-09-07 15:57:37 +02:00
|
|
|
- name: Login to the private Docker registry
|
2024-08-11 22:57:03 +02:00
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
2024-09-07 15:57:37 +02:00
|
|
|
registry: ${{ secrets.PRIVATE_REGISTRY_HOST }}
|
|
|
|
username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }}
|
|
|
|
password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}
|
2024-12-29 13:25:02 +01:00
|
|
|
|
|
|
|
- name: Build and push intermediate stages (build)
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
target: build
|
|
|
|
push: ${{ github.ref == 'refs/heads/main' }}
|
|
|
|
tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build
|
|
|
|
cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:build
|
|
|
|
cache-to: type=inline
|
|
|
|
|
|
|
|
- name: Build and push (final)
|
2024-08-12 10:02:48 +00:00
|
|
|
uses: docker/build-push-action@v6
|
2024-08-11 22:57:03 +02:00
|
|
|
with:
|
|
|
|
context: .
|
2024-12-29 13:25:02 +01:00
|
|
|
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
|
2024-08-11 22:57:03 +02:00
|
|
|
cache-to: type=inline
|