add docker workflow
Some checks failed
Docker Image CI / test (push) Successful in 1m59s
Docker Image CI / push (push) Successful in 2m2s
continuous-integration/drone/push Build is failing

This commit is contained in:
Dmitry Belyaev 2024-03-04 15:54:23 +03:00
parent f4d6e29751
commit da603ebe76

View File

@ -0,0 +1,78 @@
name: Docker Image CI
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- "master"
permissions:
packages: write
contents: read
jobs:
test:
runs-on: cth-ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v4
with:
context: .
push: false
tags: gitea.b4tman.ru/b4tman/doh-proxy:test
push:
needs: test
runs-on: cth-ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
gitea.b4tman.ru/b4tman/doh-proxy
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to gitea
uses: docker/login-action@v3
with:
registry: gitea.b4tman.ru
username: b4tman
password: ${{ secrets.PKGS_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v4
with:
context: .
push: true
#platforms: linux/amd64,linux/arm64
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}