ci: 👷 add latest tag & fix pull request actions

This commit is contained in:
Axel Olausson Holtenäs 2022-12-25 21:05:24 +01:00
parent 852538ee13
commit 0c65e3a6f8

View file

@ -1,14 +1,18 @@
name: Docker Image CI
on:
schedule:
- cron: "0 10 * * *"
push:
branches:
- "**"
- "main"
- "next"
- "dev"
tags:
- "v*.*.*"
workflow_dispatch:
- "v*"
pull_request:
branches:
- "main"
- "next"
- "dev"
jobs:
docker:
@ -28,6 +32,7 @@ jobs:
type=schedule
type=ref,event=branch
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
@ -37,11 +42,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io