-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from namshi/feature/add-github-actions
add github action for building master and release versions
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |