releases/0.8.3 #8
Workflow file for this run
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: Build and Publish to DockerHub | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/releases/') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Docker Login - Docker Hub | |
uses: Azure/docker-login@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Create Release tag | |
run: | | |
echo "bcliang/docker-libgourou" > BE_NAME | |
echo "${GITHUB_REF#refs/tags/releases/}" > RELEASE_TAG | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag $(cat BE_NAME):$(cat RELEASE_TAG) | |
- name: Tag to release + latest | |
run: | | |
docker tag $(cat BE_NAME):$(cat RELEASE_TAG) $(cat BE_NAME):latest | |
- name: Push container to dockerhub | |
run: docker push --all-tags $(cat BE_NAME) |