-
-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (85 loc) · 2.58 KB
/
brave-build-and-draft.yaml
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
name: Test Build and Create Draft Release for Brave-Based Browsertrix Browser Base
on:
push:
branches:
- "*"
jobs:
build:
name: Build x86 and ARM Images
runs-on: ubuntu-latest
permissions:
contents: write
steps:
-
name: Check out the repo
uses: actions/checkout@v3
with:
lfs: true
-
name: Read brave-version.txt
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./brave-version.txt
-
name: Set env var with brave-version
id: set-browser-version
run: echo "BRAVE_VERSION=${{ steps.package.outputs.content }}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Test build
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: false
target: brave
build-args: |
BROWSER=brave
BROWSER_VERSION=${{ env.BRAVE_VERSION }}
tags: webrecorder/browsertrix-browser-base:brave-test
platforms: "linux/amd64,linux/arm64"
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
draft_release:
needs: build
name: Create draft release
runs-on: ubuntu-latest
permissions:
contents: write
if: github.ref == 'refs/heads/main'
steps:
-
name: Check out the repo
uses: actions/checkout@v3
-
name: Read brave-version.txt
id: package
uses: juliangruber/read-file-action@v1
with:
path: ./brave-version.txt
-
name: Set env var with brave-version
id: set-browser-version
run: echo "BRAVE_VERSION=${{ steps.package.outputs.content }}" >> $GITHUB_ENV
-
name: Create draft release on GitHub
uses: ncipollo/release-action@v1
with:
draft: true
skipIfReleaseExists: true
allowUpdates: true
tag: brave-${{ env.BRAVE_VERSION }}
body: "This release publishes the image: `webrecorder/browsertrix-browser-base:brave-${{ env.BRAVE_VERSION }}`\n\nThe image is hosted [on DockerHub](https://hub.docker.com/r/webrecorder/browsertrix-browser-base/tags?name=brave-${{ env.BRAVE_VERSION }})"