forked from JSKitty/scc-web3
-
Notifications
You must be signed in to change notification settings - Fork 37
68 lines (58 loc) · 1.78 KB
/
build.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
58
59
60
61
62
63
64
65
66
67
68
name: Build and release container image
on:
push:
branches:
- "master"
paths-ignore:
- "*.md"
- LICENSE
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install npm/nodejs
uses: actions/setup-node@v4
- name: Install packages
run: npm install
- name: Build
run: npm run build
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Set tag date-SHA
id: tag
run: echo "tag=$(date +'%Y-%m-%d')-$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
tags: |
ghcr.io/pivx-labs/mypivxwallet:latest
ghcr.io/pivx-labs/mypivxwallet:${{ env.tag }}
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: release=1
push: true
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}