-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (54 loc) · 1.5 KB
/
push.yaml
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
name: Push to Master
on:
push:
branches:
- main
- release-*
tags:
- 'v*.*.*' # Matches any tag that starts with 'v' and follows semantic versioning
- 'v*.*.*-rc*'
permissions:
contents: write # This is required for actions/checkout
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/gallium
- name: build
run: |
yarn install
yarn run build
- name: checksum
if: startsWith(github.ref,'refs/tags/')
run: |
sha256sum dist/* > dist/sha256sum.txt
- name: Release
if: startsWith(github.ref,'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: "dist/*"
- name: Login to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_REPO || github.repository }}
tags: |
type=ref,event=tag
type=ref,event=branch
- name: Push dev container
uses: docker/build-push-action@v6
with:
file: Dockerfile
context: .
labels: ${{ steps.meta.outputs.labels }}
tags: "${{ steps.meta.outputs.tags }}"
push: true