This repository has been archived by the owner on Apr 27, 2024. It is now read-only.
API Docker Publish Develop #78
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: API Docker Publish Develop | |
on: | |
push: | |
branches: | |
- develop | |
workflow_run: | |
workflows: ["Build API Docker Image"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
publish-to-docker-hub: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: docker login | |
env: | |
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | |
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | |
run: | | |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | |
- name: Build and Push Docker image | |
run: | | |
cd src/TechLanches | |
TAG=$(date +%Y%m%d%H%M%S) | |
docker build -f Dockerfile.API -t ${{secrets.DOCKER_USERNAME}}/techlanches-api:$TAG -t ${{secrets.DOCKER_USERNAME}}/techlanches-api:develop . --no-cache | |
docker push ${{secrets.DOCKER_USERNAME}}/techlanches-api:$TAG | |
docker push ${{secrets.DOCKER_USERNAME}}/techlanches-api:develop |