Skip to content

Commit

Permalink
ci(docker): add docker tags for prod releases (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
wass3r authored and Neal committed Nov 13, 2019
1 parent c81349a commit 895463e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'go-vela/ui'
needs: [elm-format, elm-test, integration]
env:
NODE_ENV: production

steps:
- uses: actions/checkout@v1
Expand All @@ -164,8 +162,8 @@ jobs:
# └─┘└─┘┴┴─┘─┴┘
- name: install dependencies
run: npm i --prefer-offline --no-audit
- name: run production build
run: npm run build-prod
- name: run development build
run: npm run build

# ┌┬┐┌─┐┌─┐┬┌─┌─┐┬─┐
# │││ ││ ├┴┐├┤ ├┬┘
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2019 Target Brands, Inc. All rights reserved.
#
# Use of this source code is governed by the LICENSE file in this repository.

name: release

on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
name: release tagged image
runs-on: ubuntu-latest
env:
NODE_ENV: production

steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-
- uses: actions/setup-node@v1
with:
node-version: ${{ env.USE_NODE_VER }}

# ┌┐ ┬ ┬┬┬ ┌┬┐
# ├┴┐│ │││ ││
# └─┘└─┘┴┴─┘─┴┘
- name: install dependencies
run: npm i --prefer-offline --no-audit
- name: run production build
run: npm run build-prod

# ┌┬┐┌─┐┌─┐┬┌─┌─┐┬─┐
# │││ ││ ├┴┐├┤ ├┬┘
# ─┴┘└─┘└─┘┴ ┴└─┘┴└─
- name: push to docker
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: target/vela-ui
cache: true
tag_names: true
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 895463e

Please sign in to comment.