-
Notifications
You must be signed in to change notification settings - Fork 14
55 lines (45 loc) · 1.46 KB
/
release.yml
File metadata and controls
55 lines (45 loc) · 1.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
name: Build and Release Package
on:
release:
types: [released]
workflow_dispatch:
jobs:
build:
name: Build image
runs-on: ubuntu-24.04
steps:
- name: Set env variables
run: |
echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
echo "IMAGE_NAME=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout project
uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 22.x
- name: Get version from package.json
id: package-version
run: |
echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo "Image Name: $IMAGE_NAME"
echo "Branch Name: $BRANCH"
echo "Project Version: $VERSION"
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
id: qemu
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Run Docker buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--tag ghcr.io/$IMAGE_NAME:$VERSION \
--output "type=registry" .