Skip to content

Merge pull request #1 from norrangsvagen-se/dependabot/docker/nginx-1… #3

Merge pull request #1 from norrangsvagen-se/dependabot/docker/nginx-1…

Merge pull request #1 from norrangsvagen-se/dependabot/docker/nginx-1… #3

name: build and push
on:
push:
branches:
- "main"
paths:
- "public_html/**"
- "Dockerfile"
workflow_dispatch:
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
tags: |
type=edge
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}