-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml * Update docker-snapshot.yml
- Loading branch information
Showing
1 changed file
with
38 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,38 @@ | ||
name: Daily Docker Snapshot | ||
on: | ||
schedule: #to be pushed daily, at 07:00 PM (19:00) | ||
- cron: '0 19 * * *' #NOTE: Only works if the workflow file is present in the default branch | ||
jobs: | ||
Pushing-Docker-Image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: develop #pushing the image from the develop branch | ||
|
||
- name: Setting Up Docker Buildx #used for caching image layers, improves performance | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
|
||
- name: Get and Set Version | ||
run: | | ||
source ci/set-docker-image-version.sh | ||
echo "version=${DOCKER_IMG_VER}" >> $GITHUB_ENV | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
builder: ${{ steps.buildx.outputs.name }} | ||
file: ./Dockerfile | ||
push: true | ||
tags: ga4gh/ga4gh-starter-kit-common:snapshot #The docker image is tagged :snapshot | ||
build-args: VERSION=${{ env.version }} | ||
cache-from: type=gha #GitHub Actions Cache Exporter | ||
cache-to: type=gha,mode=max |