forked from external-repos/noisedash
Some checks failed
build-and-push-docker / docker (push) Failing after 2m0s
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
name: build-and-push-docker
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, master, dev ]
|
|
tags:
|
|
- 'v*.*.*'
|
|
pull_request:
|
|
branches: [ main, master, dev ]
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install system Dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y curl jq docker.io
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.purpleraft.com
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels)
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.purpleraft.com/${{ gitea.repository_owner }}/noisedash
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
type=sha
|
|
|
|
- name: Build (PR only)
|
|
if: ${{ gitea.event_name == 'pull_request' }}
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: false
|
|
platforms: linux/amd64
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Build and push (branches/tags)
|
|
if: ${{ gitea.event_name != 'pull_request' }}
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|