-
Notifications
You must be signed in to change notification settings - Fork 19
60 lines (47 loc) · 1.5 KB
/
release.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: Release Workflow
on:
push:
tags:
- 'v*' # Matches tags starting with 'v'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install dependencies
run: npm install
- name: Get Package Version
id: get_package_version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- name: Build
run: npm run build
- name: Log in to Docker Hub
run: docker login -u bleckbeard -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker image
run: |
VERSION=${{ env.VERSION }}
echo "Building docker image"
docker build -t bleckbeard/hiccup:latest .
docker tag bleckbeard/hiccup:latest bleckbeard/hiccup:v$VERSION
echo "Pushing it to the hub"
docker push bleckbeard/hiccup:latest
docker push bleckbeard/hiccup:v$VERSION
- name: Zip build artifacts
run: zip -r hiccup@$VERSION.zip ./build/
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
generate_release_notes: true
files: |
hiccup@${{ env.VERSION }}.zip