huawei_lte_exporter/.gitea/workflows/docker.yml

49 lines
1.1 KiB
YAML
Raw Normal View History

2024-03-26 14:37:35 +01:00
name: ci
on:
push:
branches:
2024-03-28 11:00:41 +01:00
- "*"
2024-03-26 14:37:35 +01:00
tags:
2024-03-28 11:00:41 +01:00
- "*"
2024-03-26 14:37:35 +01:00
pull_request:
branches:
2024-03-28 11:00:41 +01:00
- "main"
2024-03-26 14:37:35 +01:00
jobs:
docker:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
2024-03-28 11:00:41 +01:00
2024-03-26 14:37:35 +01:00
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
2024-03-28 11:00:41 +01:00
git.sebclem.fr/${{ gitea.repository }}
2024-03-26 14:37:35 +01:00
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
2024-03-28 11:00:41 +01:00
type=semver,pattern={{major}}.{{minor}}
- name: Login to registry
if: github.ref_type == 'tag'
2024-03-26 14:37:35 +01:00
uses: docker/login-action@v3
with:
registry: git.sebclem.fr
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2024-03-28 11:00:41 +01:00
2024-03-26 14:37:35 +01:00
- name: Build and push
uses: docker/build-push-action@v6
2024-03-26 14:37:35 +01:00
with:
context: .
2024-03-28 11:00:41 +01:00
push: ${{ github.ref_type == 'tag' }}
2024-03-26 14:37:35 +01:00
tags: ${{ steps.meta.outputs.tags }}
2024-03-28 11:00:41 +01:00
labels: ${{ steps.meta.outputs.labels }}