forked from lukasheinrich/folding-at-home-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI with GitHub Actions to test and publish
- Loading branch information
1 parent
ae99cee
commit 7668b0b
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,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 |
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,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 |