-
Notifications
You must be signed in to change notification settings - Fork 26
60 lines (54 loc) · 1.83 KB
/
main.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
name: main
on:
push:
tags:
- '*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Build
run: |
version=`git describe --tags`
npm i
npm run build
cd dist
zip -r headscale-ui-${{ github.ref_name }}.zip headscale-ui
- name: Create GitHub release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ env.ReleaseVersion }}
title: ${{ env.ReleaseVersion }}
prerelease: false
files: |
dist/headscale-ui-${{ github.ref_name }}.zip
- name: Create Docker File
run: |
echo "FROM nginx:alpine" > Dockerfile
echo "COPY dist/headscale-ui /usr/share/nginx/html/manager" >> Dockerfile
echo "WORKDIR /usr/share/nginx/html/" >> Dockerfile
pwd
cat Dockerfile
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Images for Multi Platform
# You may pin to the exact commit or the version.
# uses: huaweicloud/swr-multiplatform-build-action@0dba9fc56ef5a21bc21884b29101e584fbbb539c
uses: huaweicloud/[email protected]
with:
# the docker images build tag
image_tag: simcu/headscale-ui:${{ github.ref_name }}
platforms: linux/amd64,linux/arm64
push: true