-
Notifications
You must be signed in to change notification settings - Fork 1.3k
60 lines (57 loc) · 1.82 KB
/
Copy pathdockerbuild.yml
File metadata and controls
60 lines (57 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build Container Image
on:
push:
branches:
- 'master'
tags:
- '20*'
pull_request:
branches:
- 'master'
paths:
- .github/workflows/**
- Dockerfile
permissions:
contents: read
packages: write
jobs:
bake:
runs-on: ubuntu-24.04-arm
steps:
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
with:
images: |
${{ secrets.DOCKER_PASSWORD && 'rssbridge/rss-bridge' || '' }}
ghcr.io/${{github.repository_owner}}/${{github.event.repository.name}}
tags: |
type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }}
type=sha
type=ref,event=tag,enable=${{ startsWith(github.ref, 'refs/tags/20') }}
type=raw,value=stable,enable=${{ startsWith(github.ref, 'refs/tags/20') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to DockerHub
uses: docker/login-action@v4
if: ${{ github.repository == 'rss-bridge/rss-bridge' && github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/bake-action@v6
with:
files: |
./docker-bake.hcl
cwd://${{ steps.docker_meta.outputs.bake-file }}
targets: image-all
push: ${{ github.event_name != 'pull_request' }}