36 lines
1.0 KiB
YAML
Raw Permalink Normal View History

2024-09-07 15:57:37 +02:00
name: Build Nginx-based docker image
2024-08-11 22:57:03 +02:00
on:
push:
branches:
- main
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
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-08-11 22:57:03 +02:00
- name: Build and push
uses: docker/build-push-action@v6
2024-08-11 22:57:03 +02:00
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
2024-09-07 15:57:37 +02:00
tags: |
${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest
2024-08-11 22:57:03 +02:00
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline