-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.48 KB
/
cd.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
name: Continuous Deployment
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image
run: |
docker build --platform linux/${{ matrix.arch }} -t protodesk .
- name: Run Docker image
run: |
docker run --name protodesk-container protodesk
- name: Copy build from container to host
run: |
docker cp protodesk-container:/app/dist ./dist
- name: Create a versioned archive of the build
run: |
cd dist && tar -czf protodesk-${{ github.event.release.tag_name }}_${{ matrix.arch }}.tar.gz app/
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url}}
asset_path: dist/protodesk-${{ github.event.release.tag_name }}_${{ matrix.arch }}.tar.gz
asset_name: protodesk-${{ github.event.release.tag_name }}_${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip