Skip to content

Commit

Permalink
feat: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
guitarrapc committed May 25, 2020
1 parent 605cb35 commit 477ffd3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker Build

on: [push, pull_request]

env:
OWNER: guitarrapc
IMAGE_NAME: docker-awscli-kubectl

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build --build-arg VCS_REF=$(git rev-parse --short HEAD) -t ${OWNER}/${IMAGE_NAME}:latest .
21 changes: 21 additions & 0 deletions .github/workflows/docker_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docker Push

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*" # only tag with pattern match

env:
OWNER: guitarrapc
IMAGE_NAME: docker-awscli-kubectl

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/tags/}
- uses: actions/checkout@v2
- run: docker build --build-arg VCS_REF=$(git rev-parse --short HEAD) -t ${OWNER}/${IMAGE_NAME}:latest .
- run: docker tag ${OWNER}/${IMAGE_NAME}:latest ${OWNER}/${IMAGE_NAME}:${GIT_TAG}
- run: docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
- run: docker push ${OWNER}/${IMAGE_NAME}

0 comments on commit 477ffd3

Please sign in to comment.