Skip to content

Add Gotify

Add Gotify #20

Workflow file for this run

name: Build and publish Docker image
on:
workflow_dispatch:
release:
types: [published]
pull_request:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.10.0
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
flavor: latest=${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha, enable=${{ !startsWith(github.ref, 'refs/tags/') }}
type=edge
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha
cache-to: type=gha
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}