-
Notifications
You must be signed in to change notification settings - Fork 26
105 lines (92 loc) · 3.1 KB
/
Copy pathrelease.yml
File metadata and controls
105 lines (92 loc) · 3.1 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Release
on:
push:
branches: [main]
jobs:
release:
name: Semantic release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
new_release_published: ${{ steps.release.outputs.new_release_published }}
new_release_version: ${{ steps.release.outputs.new_release_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Run semantic-release
id: release
uses: cycjimmy/semantic-release-action@v4
with:
extra_plugins: |
conventional-changelog-conventionalcommits@8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
name: Build & push release images
needs: release
if: needs.release.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
build-args: |
APP_VERSION=${{ needs.release.outputs.new_release_version }}
tags: |
bellamy/scrob:latest
bellamy/scrob:main
bellamy/scrob:${{ needs.release.outputs.new_release_version }}
ghcr.io/ellite/scrob:latest
ghcr.io/ellite/scrob:main
ghcr.io/ellite/scrob:${{ needs.release.outputs.new_release_version }}
cache-from: type=gha,scope=scrob-release
cache-to: type=gha,mode=max,scope=scrob-release
- name: Build and push omnibus image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.omnibus
platforms: linux/amd64,linux/arm64
push: true
build-args: |
APP_VERSION=${{ needs.release.outputs.new_release_version }}
tags: |
bellamy/scrob:latest-omnibus
bellamy/scrob:main-omnibus
bellamy/scrob:${{ needs.release.outputs.new_release_version }}-omnibus
ghcr.io/ellite/scrob:latest-omnibus
ghcr.io/ellite/scrob:main-omnibus
ghcr.io/ellite/scrob:${{ needs.release.outputs.new_release_version }}-omnibus
cache-from: type=gha,scope=scrob-omnibus-release
cache-to: type=gha,mode=max,scope=scrob-omnibus-release