decktape/.github/workflows/image.yml

76 lines
1.8 KiB
YAML
Raw Normal View History

2023-02-14 13:57:37 +03:00
name: image
permissions:
packages: write
on:
push:
branches:
- master
tags:
- 'v*'
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- 'LICENSE'
jobs:
buildx:
if: github.repository_owner == 'astefanutti'
name: buildx
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
2023-02-14 13:57:37 +03:00
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
2023-02-14 13:57:37 +03:00
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
2023-02-14 13:57:37 +03:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
2023-02-14 13:57:37 +03:00
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
2023-02-14 13:57:37 +03:00
with:
images: |
ghcr.io/${{ github.repository_owner }}/decktape
tags: |
type=ref,event=branch
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
- name: Build and push
uses: docker/build-push-action@v6
2023-02-14 13:57:37 +03:00
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=${{ github.ref_name }}
cache-to: type=gha,scope=${{ github.ref_name }},mode=max
provenance: false