Update nginx version #44
This file contains 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 docker image | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- 'v*.*.*' | |
paths: | |
- 'src/**.c' | |
- 'Dockerfile' | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Merge build image & test image | |
run: cat Dockerfile Dockerfile.test > Dockerfile.merged | |
- name: Test | |
id: docker_test_image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile.merged | |
push: false | |
cache-from: type=gha,scope=main | |
cache-to: type=gha,mode=max,scope=main | |
build: | |
needs: | |
- test | |
name: Build image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=semver,pattern={{raw}} | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
id: docker_build_image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=gha,scope=main | |
cache-to: type=gha,mode=max,scope=main |