0.5.1 #13
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: docker-release | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
deploy: | |
if: "!github.event.release.prerelease" | |
name: Build and publish to docker hub | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
SERVICE_NAME: ilagent | |
REGISTRY: ilert | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build, tag, and push image | |
id: build-image | |
env: | |
IMAGE_TAG_1: ${{ github.sha }} | |
IMAGE_TAG_2: ${{ github.event.release.tag_name }} | |
run: | | |
docker build -t ${REGISTRY}/${SERVICE_NAME}:${IMAGE_TAG_1} -t ${REGISTRY}/${SERVICE_NAME}:${IMAGE_TAG_2} -t ${REGISTRY}/${SERVICE_NAME}:latest . | |
docker push ${REGISTRY}/${SERVICE_NAME}:${IMAGE_TAG_1} | |
docker push ${REGISTRY}/${SERVICE_NAME}:${IMAGE_TAG_2} | |
docker push ${REGISTRY}/${SERVICE_NAME}:latest |