This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (70 loc) · 2.35 KB
/
publish.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
name: publish
on:
push:
branches: ['master','main']
tags: ['v*.*.*']
concurrency: ${{ github.ref }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-amd64:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: qemu
uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v3
with:
flavor: |
latest=false
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Semantic versioning from our tags
type=semver,pattern={{version}}
# tag the sha version unless we are a git tag
type=sha,enable=${{ !startsWith(github.ref, 'refs/tags/v') }},priority=300,format=long,prefix=
- id: meta-arch
uses: docker/metadata-action@v3
with:
flavor: |
latest=false
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Semantic versioning from our tags
type=semver,pattern={{version}}
# Branch
type=ref,event=branch
# tag the sha version unless we are a git tag
type=sha,enable=${{ !startsWith(github.ref, 'refs/tags/v') }},priority=300,format=long,prefix=
- name: update version
run: |
echo "const version = \"${{ steps.meta.outputs.version }}\";" > client/src/version.ts
echo "export default version;" >> client/src/version.ts
- name: push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta-arch.outputs.tags }}
labels: ${{ steps.meta-arch.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# TEMP fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache