From 3cb46925204ef75a2d08e964057362e25f7bbb72 Mon Sep 17 00:00:00 2001 From: Emre Ferhatoglu <97183433+emre-f@users.noreply.github.com> Date: Wed, 26 Jan 2022 16:53:11 -0500 Subject: [PATCH] Create docker-snapshot.yml --- .github/workflows/docker-snapshot.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/docker-snapshot.yml diff --git a/.github/workflows/docker-snapshot.yml b/.github/workflows/docker-snapshot.yml new file mode 100644 index 0000000..f607a90 --- /dev/null +++ b/.github/workflows/docker-snapshot.yml @@ -0,0 +1,38 @@ +name: Daily Docker Snapshot +on: + schedule: #to be pushed daily, at 07:00 PM (19:00) + - cron: '* 19 * * *' +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