Skip to content

Commit

Permalink
Merge pull request #69 from namshi/feature/add-github-actions
Browse files Browse the repository at this point in the history
add github action for building master and release versions
  • Loading branch information
oba11 authored May 27, 2020
2 parents 7d4a6ef + be95e12 commit a7421e1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'master'

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Login
run: docker login docker.pkg.github.com -u namshi -p $GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build
run: docker build --tag docker.pkg.github.com/namshi/docker-smtp/smtp:latest .
- name: Docker Publish
run: docker push docker.pkg.github.com/namshi/docker-smtp/smtp:latest
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'release'

on:
push:
tags:
- 'v*.*.*'
- '!v*.*.*-*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}

- name: Docker Login
run: docker login docker.pkg.github.com -u namshi -p $GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build
run: docker build --tag docker.pkg.github.com/namshi/docker-smtp/smtp:${{ steps.get_version.outputs.VERSION }} .
- name: Docker Publish
run: docker push docker.pkg.github.com/namshi/docker-smtp/smtp:${{ steps.get_version.outputs.VERSION }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

0 comments on commit a7421e1

Please sign in to comment.