Add back .gitkeep #12
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
name: Docker Build | |
on: | |
push: | |
branches: | |
- master | |
- docker | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout github repo (+ download lfs dependencies) | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Get version from tag or commit hash | |
id: get_version | |
run: | | |
if [[ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]]; then | |
echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/}" | |
else | |
echo "::set-output name=VERSION::$(git rev-parse --short HEAD)" | |
fi | |
- name: Build Docker image | |
run: | | |
docker build -t groundgan:${{ steps.get_version.outputs.VERSION }} -f docker/Dockerfile . | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_UNAME }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Push Docker image | |
run: | | |
docker tag groundgan:${{ steps.get_version.outputs.VERSION }} yazdanz/groundgan:${{ steps.get_version.outputs.VERSION }} | |
docker push yazdanz/groundgan:${{ steps.get_version.outputs.VERSION }} |