on master #49
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: Image Build | |
run-name: "${{ github.event.pull_request.title || 'on master' }}" | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
name: "Build the docker image" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: build | |
run: docker build -t kunalsin9h/newsletter:latest . | |
- name: push to docker hub | |
if: github.ref == 'refs/heads/master' | |
run : | | |
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "kunalsin9h" --password-stdin | |
docker push kunalsin9h/newsletter:latest | |
docker tag kunalsin9h/newsletter:latest ghcr.io/kunalsin9h/newsletter:latest | |
echo "${{ secrets.GHCR }}" | docker login ghcr.io -u "kunalsin9h" --password-stdin | |
docker push ghcr.io/kunalsin9h/newsletter:latest |