Skip to content

Merge pull request #67 from eftechcombr/dependabot/github_actions/doc… #138

Merge pull request #67 from eftechcombr/dependabot/github_actions/doc…

Merge pull request #67 from eftechcombr/dependabot/github_actions/doc… #138

name: Nginx
on:
# workflow_run:
# workflows: ["PHP"]
# types:
# - completed
# branches:
# - "latest"
# - "10.0.*"
schedule:
- cron: '1 1 1 * *'
push:
branches:
- "10.0.*"
- "latest"
env:
# Use docker.io for Docker Hub if empty
# REGISTRY: ghcr.io
REGISTRY: "docker.io"
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
# VERSION: "10.0.15"
jobs:
build-nginx:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446
with:
registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,enable=true,priority=600,prefix=nginx-,suffix=,event=branch
# type=raw,value=nginx-${{ env.VERSION }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25
with:
context: ./docker/nginx/
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max