-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (75 loc) · 2.73 KB
/
release.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
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
name: Release version
on:
push:
tags:
- '*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Read metadata
uses: docker/metadata-action@v5
id: meta
with:
images: nioc/own-my-money
tags: |
type=semver,pattern={{version}}
flavor: |
latest=true
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
cache-dependency-path: 'money-front-vue/package-lock.json'
- name: Build front
run: cd money-front-vue && npm install && npm run build
- name: Create release archive
shell: bash
run: |
mkdir -p own-my-money/money-front-vue/dist &&
cp -a money-front-vue/dist/ own-my-money/money-front-vue -r &&
cp -a server/ own-my-money/ -r &&
cp -a *.md own-my-money/ &&
tar zcvf own-my-money-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}.tar.gz own-my-money &&
rm own-my-money -r
- name: Draft Github release with archive
uses: softprops/action-gh-release@v2
with:
draft: true
files: own-my-money-${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}.tar.gz
body: |
### Features
### Bug fixes
### Technical
- name: Prepare docker build context
shell: bash
run: |
mkdir image-build &&
cp -a money-front-vue/dist image-build/front -r &&
cp -a server image-build/ -r &&
cp -a docker image-build/ -r
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push docker multi architecture image
id: docker_build
uses: docker/build-push-action@v5
with:
context: image-build
file: docker/Dockerfile-multiarch
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
GIT_COMMIT=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
tags: ${{ steps.meta.outputs.tags }}