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@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
2023-07-29 17:01:58 +00:00
- name: Set up Docker Buildx
id: buildx
uses: https://github.com/docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.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@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.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@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.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@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.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 }}