-
-
Notifications
You must be signed in to change notification settings - Fork 1
26 lines (23 loc) · 847 Bytes
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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