Skip to content

Merge pull request #11 from LydonThorpe/patch-1 #20

Merge pull request #11 from LydonThorpe/patch-1

Merge pull request #11 from LydonThorpe/patch-1 #20

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
branches:
- main
permissions: read-all
jobs:
push_to_registry:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest
environment: dev3
outputs:
image_digest: ${{ steps.build.outputs.digest }}
steps:
- name: Check out the repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Log in to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893
with:
images: danielhmetro/new-install-notifier
- name: Build and push Docker image
id: build
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: ./
file: ./Dockerfile
push: true
tags: danielhmetro/new-install-notifier:latest
labels: ${{ steps.meta.outputs.labels }}
deploy_to_dev3:
name: Deploy to dev 3
uses: ./.github/workflows/helm_deploy.yaml
with:
environment: dev3
image_digest: ${{ needs.push_to_registry.outputs.image_digest }}
secrets: inherit
needs: push_to_registry
deploy_to_prod1:
name: Deploy to prod 1
uses: ./.github/workflows/helm_deploy.yaml
with:
environment: prod1
image_digest: ${{ needs.push_to_registry.outputs.image_digest }}
secrets: inherit
needs: [ push_to_registry, deploy_to_dev3 ]
if: github.ref == 'refs/heads/main'