-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.31 KB
/
push.yml
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
name: Build
on:
workflow_dispatch:
push:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test
# Only on version tag
- name: Get package version
id: get_version
run: |
echo "VERSION3=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
echo "VERSION2=$(node -p "require('./package.json').version.split('.').slice(0, 2).join('.')")" >> "$GITHUB_OUTPUT"
- uses: docker/login-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
if: startsWith(github.ref, 'refs/tags/v')
- uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/tags/v')
with:
context: .
push: true
tags: |
thgh/hivepanel:${{ steps.get_version.outputs.VERSION3 }}
thgh/hivepanel:${{ steps.get_version.outputs.VERSION2 }}
thgh/hivepanel:latest
platforms: linux/amd64,linux/arm64/v8