This repository has been archived on 2024-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OMB-Season-3/.gitea/workflows/docker.yaml
Marijn Doeve f4d0073b3b
Some checks failed
Build / Build Image (push) Failing after 9s
add registery
2023-06-21 18:44:02 +02:00

67 lines
1.9 KiB
YAML

name: Build
on:
push:
branches: ["main"]
# Publish semver tags as releases.
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
env:
# # Use docker.io for Docker Hub if empty
REGISTRY: gitea.marijndoeve.nl
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build:
name: Build Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Workaround: https://gitea.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: gitea.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
# - name: Extract Docker metadata
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
file: docker/web/Containerfile
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max