Merge pull request #82 from trevdor/patch-1

Build docker image on push to master or tag
This commit is contained in:
Trevor Farlow 2022-10-19 21:32:16 -06:00 committed by GitHub
commit 5252edbf70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,32 @@
name: Build Docker Image name: Build Docker Image
# Docker Images are only built when a new tag is created # Docker Images are built for every push to master or when a new tag is created
on: on:
push: push:
branches:
- master
tags: tags:
- 'v*.*.*' - 'v*.*.*'
paths-ignore:
- README.md
- LICENSE.txt
env:
IMAGES: |
jlongster/actual-server
ghcr.io/actualbudget/actual-server
# Creates the following tags:
# - actual-server:latest (see docker/metadata-action flavor inputs, below)
# - actual-server:edge (for master)
# - actual-server:1.3
# - actual-server:1.3.7
# - actual-server:sha-90dd603
TAGS: |
type=edge,value=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
jobs: jobs:
build: build:
@ -24,35 +46,22 @@ jobs:
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
# Push to both Docker Hub and Github Container Registry # Push to both Docker Hub and Github Container Registry
images: | images: ${{ env.IMAGES }}
jlongster/actual-server # Automatically update :latest for our semver tags
ghcr.io/actualbudget/actual-server flavor: |
# Creates the following tags: latest=auto
# - actual-server:latest tags: ${{ env.TAGS }}
# - actual-server:1.3
# - actual-server:1.3.7
# - actual-server:sha-90dd603
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Docker meta for Alpine image - name: Docker meta for Alpine image
id: alpine-meta id: alpine-meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: | images: ${{ env.IMAGES }}
jlongster/actual-server # Automatically update :latest for our semver tags and suffix all tags
ghcr.io/actualbudget/actual-server flavor: |
tags: | latest=auto
type=ref,event=branch suffix=-alpine,onlatest=true
type=ref,event=pr tags: $${{ env.TAGS }}
type=raw,value=latest,suffix=-alpine
type=semver,pattern={{version}},suffix=-alpine
type=semver,pattern={{major}}.{{minor}},suffix=-alpine
type=sha,suffix=-alpine
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1