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

63 lines
1.7 KiB
YAML
Raw Normal View History

name: docker-ci
on:
push:
2023-10-07 19:25:14 +02:00
tags:
- 'v*.*.*'
jobs:
docker:
runs-on: ubuntu-latest
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: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}
# 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:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_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}}'