Skip to content

Commit

Permalink
Added action to build image from tags
Browse files Browse the repository at this point in the history
  • Loading branch information
exelban authored Sep 18, 2019
1 parent b617de5 commit 4e95eaa
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: GitHub Registry :version

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set version tag
id: tag
run: |
VERSION_TAG=$(echo ${GITHUB_REF##*/} | sed -e "s#^v##")
echo ::set-env name=GITHUB_TAG::$VERSION_TAG
echo ::set-env name=APP_NAME::app
- uses: actions/checkout@master

- name: Login to github registry
uses: actions/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY_URL: docker.pkg.github.com

- name: Build image
uses: actions/docker/cli@master
with:
args: build -t docker.pkg.github.com/${GITHUB_REPOSITORY}/cli:${GITHUB_TAG} .

- name: Push to registry
uses: actions/docker/cli@master
with:
args: push docker.pkg.github.com/${GITHUB_REPOSITORY}/cli:${GITHUB_TAG}

0 comments on commit 4e95eaa

Please sign in to comment.