runner-images/.forgejo/workflows/build.yaml

48 lines
1.5 KiB
YAML
Raw Normal View History

2023-07-29 17:01:58 +00:00
name: Build image
on:
pull_request:
push:
branches:
- main
jobs:
build:
runs-on: hetzner
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2023-07-29 17:01:58 +00:00
with:
github-server-url: https://code.mor.re
- name: Set up QEMU
uses: https://github.com/docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
2023-07-29 17:01:58 +00:00
- name: Set up Docker Buildx
id: buildx
uses: https://github.com/docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
2023-07-29 17:01:58 +00:00
- name: Login to registry
if: github.event_name != 'pull_request'
uses: https://github.com/docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
2023-07-29 17:01:58 +00:00
with:
registry: code.mor.re
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Docker meta
id: meta
uses: https://github.com/docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
2023-07-29 17:01:58 +00:00
with:
flavor: |
latest=false
images: |
code.mor.re/${{ github.repository }}
- name: Build and push
uses: https://github.com/docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
2023-07-29 17:01:58 +00:00
with:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}