Skip to content

Commit 59b8fbe

Browse files
authored
Create docker-snapshot.yml (#43)
* Create docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml
1 parent 27c79e1 commit 59b8fbe

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/docker-snapshot.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Daily Docker Snapshot
2+
on:
3+
schedule: #to be pushed daily, at 07:00 PM (19:00)
4+
- cron: '0 19 * * *' #NOTE: Only works if the workflow file is present in the default branch
5+
jobs:
6+
Pushing-Docker-Image:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
ref: develop #pushing the image from the develop branch
12+
13+
- name: Setting Up Docker Buildx #used for caching image layers, improves performance
14+
id: buildx
15+
uses: docker/setup-buildx-action@v1
16+
17+
- name: Login to Docker Hub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22+
23+
- name: Get and Set Version
24+
run: |
25+
source ci/set-docker-image-version.sh
26+
echo "version=${DOCKER_IMG_VER}" >> $GITHUB_ENV
27+
28+
- name: Build and push
29+
uses: docker/build-push-action@v2
30+
with:
31+
context: .
32+
builder: ${{ steps.buildx.outputs.name }}
33+
file: ./Dockerfile
34+
push: true
35+
tags: ga4gh/ga4gh-starter-kit-common:snapshot #The docker image is tagged :snapshot
36+
build-args: VERSION=${{ env.version }}
37+
cache-from: type=gha #GitHub Actions Cache Exporter
38+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)