astraproxy/.github/workflows/docker-ci.yml

73 lines
1.8 KiB
YAML
Raw Normal View History

name: docker-ci
on:
push:
2023-10-07 19:25:14 +02:00
tags:
- 'v*.*.*'
2024-02-11 20:17:09 +01:00
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
2024-02-11 20:17:09 +01:00
build-and-push-image:
runs-on: ubuntu-latest
2024-02-11 20:17:09 +01:00
permissions:
contents: read
packages: write
steps:
2021-06-09 15:02:05 +02:00
-
name: Checkout
2023-10-07 19:25:14 +02:00
uses: actions/checkout@v4
2021-06-09 15:02:05 +02:00
with:
fetch-depth: 0
-
name: Find Git Tag
id: tagger
2021-06-09 16:23:50 +02:00
uses: jimschubert/query-tag-action@v2
2021-06-09 15:02:05 +02:00
with:
include: 'v*'
exclude: '*-rc*'
2021-06-09 16:33:45 +02:00
commit-ish: 'HEAD'
2021-06-09 15:02:05 +02:00
skip-unshallow: 'true'
2021-06-09 16:23:50 +02:00
abbrev: 7
2023-10-07 19:25:14 +02:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
2023-10-07 19:25:14 +02:00
# list of Docker images to use as base name for tags
images: |
2024-02-11 20:17:09 +01:00
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
2023-10-07 19:25:14 +02:00
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up QEMU
2023-10-07 19:25:14 +02:00
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
2023-10-07 19:25:14 +02:00
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
2023-10-07 19:25:14 +02:00
uses: docker/login-action@v3
with:
2024-02-11 20:17:09 +01:00
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
2023-10-07 19:25:14 +02:00
name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
2021-06-09 16:32:46 +02:00
context: .
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
push: true
2023-10-07 19:25:14 +02:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: 'GIT_DESC=${{steps.tagger.outputs.tag}}'