-
-
Notifications
You must be signed in to change notification settings - Fork 57
85 lines (72 loc) · 2.46 KB
/
Copy pathdocker-buildx-bun.yml
File metadata and controls
85 lines (72 loc) · 2.46 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
name: Build Docker Image bun with buildx
on:
# Allow manual dispatch
workflow_dispatch:
# Cancel previous runs when a new one is triggered
concurrency:
group: docker-build-bun
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code to main branch
uses: actions/checkout@v7
- name: Setup Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: '24.x'
cache: npm
- name: Verify Node.js version
run: node -v
- name: Verify Npm version
run: npm -v
- name: Set metadata
id: meta
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "VCS_REF=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Write build metadata to .dockerbuild.json
run: |
cat > .dockerbuild.json <<EOF
{
"version": "${{ steps.meta.outputs.VERSION }}",
"sha": "${GITHUB_SHA}",
"sha7": "${GITHUB_SHA::7}",
"event": "${GITHUB_EVENT_NAME}",
"workflow": "${GITHUB_WORKFLOW}",
"type": "${GITHUB_REF_TYPE}",
"name": "${GITHUB_REF_NAME}",
"dev": false
}
EOF
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
version: latest
- name: Run Docker Buildx with Dockerfile.bun for version ${{ steps.meta.outputs.VERSION }}
run: |
docker buildx build \
--no-cache \
--pull \
--platform linux/amd64,linux/arm64 \
-f docker/Dockerfile.bun \
-t luligu/matterbridge:bun \
-t luligu/matterbridge:bun-${{ steps.meta.outputs.VERSION }} \
--build-arg VERSION=${{ steps.meta.outputs.VERSION }} \
--build-arg VCS_REF=${{ steps.meta.outputs.VCS_REF }} \
--build-arg BUILD_DATE=${{ steps.meta.outputs.BUILD_DATE }} \
--push .
docker manifest inspect luligu/matterbridge:bun
timeout-minutes: 60