Skip to content

Commit

Permalink
Add CI with GitHub Actions to test and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Mar 19, 2020
1 parent ae99cee commit 7668b0b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI/CD

on:
push:
schedule:
- cron: '1 0 * * *'

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Build Docker image
run: |
docker build . \
--file simple/Dockerfile \
--tag lukasheinrich/folding:$GITHUB_SHA \
--compress
docker images
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker Images

on:
push:
branches:
- master
tags:
- v*

jobs:
build-and-publish:
name: Build and publish Docker images to Docker Hub
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Build and Publish to Registry
if: "! ${{ startsWith(github.ref, 'refs/tags/') }}"
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lukasheinrich/folding
dockerfile: simple/Dockerfile
tags: latest,simple
- name: Build and Publish to Registry with Release Tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: lukasheinrich/folding
dockerfile: simple/Dockerfile
tags: latest,latest-stable,simple
tag_with_ref: true

0 comments on commit 7668b0b

Please sign in to comment.