-
Notifications
You must be signed in to change notification settings - Fork 8
100 lines (96 loc) · 3.79 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
90
91
92
93
94
95
96
97
98
99
100
name: Build Arka Docker image
on:
push:
branches:
- "master"
jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout frontend
uses: actions/checkout@v4
- name: Get frontend package version
id: get_frontend_version
run: echo frontend_version=$(node -p "require('./frontend/package.json').version") >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:${{ steps.get_frontend_version.outputs.frontend_version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:latest
platforms: linux/amd64,linux/arm64
build_admin_frontend:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout admin_frontend
uses: actions/checkout@v4
- name: Get admin_frontend package version
id: get_admin_frontend_version
run: echo admin_frontend_version=$(node -p "require('./admin_frontend/package.json').version") >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push admin_frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./admin_frontend
file: ./admin_frontend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:${{ steps.get_admin_frontend_version.outputs.admin_frontend_version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:latest
platforms: linux/amd64,linux/arm64
build_backend:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout backend
uses: actions/checkout@v4
- name: Get backend package version
id: get_backend_version
run: echo backend_version=$(node -p "require('./backend/package.json').version") >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push backend Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:${{ steps.get_backend_version.outputs.backend_version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:latest
platforms: linux/amd64,linux/arm64
- name: Create GitHub release
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.get_backend_version.outputs.backend_version }}
prerelease: false
title: Arka ${{ steps.get_backend_version.outputs.backend_version }}
- name: Trigger pipeline
run: ${{ secrets.PIPELINE_TRIGGER }}