-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (70 loc) · 2.39 KB
/
build_and_push.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: Build and push
on:
push:
branches:
- master
jobs:
bump-version:
name: "Bump Version on master"
runs-on: ubuntu-latest
steps:
- name: "Checkout source code"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}
fetch-depth: 50
- name: "cat package.json"
run: cat ./package.json
- name: "Setup Node.js"
uses: "actions/setup-node@v1"
with:
node-version: 12
- name: "Automated Version Bump"
id: version-bump
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: ''
minor-wording: 'minor_bump'
major-wording: 'major_bump'
patch-wording: 'patch_bump'
rc-wording: 'alpha_bump'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "cat package.json"
run: cat ./package.json
- name: 'Output Step'
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
- name: "publish release notes"
uses: fregante/release-with-changelog@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
build:
name: "Build angles-ui container and push to docker hub"
needs: bump-version
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 12.x ]
steps:
- uses: actions/checkout@v1
- run: git pull origin master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Grab AnglesUI version
id: extract_version
uses: Saionaro/[email protected]
# From now you can access the version
- name: Print version
run: echo ${{ steps.extract_version.outputs.version }}
- name: Login to Docker Hub
run: docker login --username "${{ secrets.DOCKER_USERNAME }}" --password "${{ secrets.DOCKER_PASSWORD }}"
- name: Build the Docker Image
run: docker build . --file Dockerfile -t angleshq/angles-ui:${{ steps.extract_version.outputs.version }} -t angleshq/angles-ui:latest
- name: Push the Docker Image with version
run: docker push angleshq/angles-ui:${{ steps.extract_version.outputs.version }}
- name: Push the Docker Image with latest
run: docker push angleshq/angles-ui:latest