livereload-basic-v2.1.1 #1
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: Deploy to Production Environment | |
on: | |
release: | |
types: [published] | |
jobs: | |
docker-build-push-tag: | |
name: Push Tagged Image | |
if: github.event.release.target_commitish == 'master' && vars.DOCKERHUB_USERNAME != '' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Set release version number | |
run: sed -i -e "s/latest/${{ github.event.release.tag_name }}/g" docker-compose.dev.yml | |
- name: Build Image | |
run: docker compose -f docker-compose.dev.yml build | |
- name: Push Image to Docker Hub | |
run: docker compose -f docker-compose.dev.yml push | |
docker-build-push: | |
name: Push Development Image | |
if: github.event.release.target_commitish == 'master' && vars.DOCKERHUB_USERNAME != '' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- name: Build Image | |
run: docker compose -f docker-compose.dev.yml build | |
- name: Push Image to Docker Hub | |
run: docker compose -f docker-compose.dev.yml push |