-
Notifications
You must be signed in to change notification settings - Fork 4k
47 lines (40 loc) · 1.31 KB
/
docker.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: 'Build & Push Docker Image'
on:
schedule:
- cron: "0 0 * * 0" # Every Sunday
workflow_dispatch:
env:
CI: true
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Image
run: |
# Build Docker Image for DockerHub
docker build --tag htrtech/zphisher:latest .
# Tag Docker Image for GHCR
docker tag htrtech/zphisher:latest ghcr.io/htr-tech/zphisher:latest
- name: Login to GHCR
if: github.repository == 'htr-tech/zphisher' && github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: github.repository == 'htr-tech/zphisher' && github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
username: "htrtech"
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push
if: github.repository == 'htr-tech/zphisher' && github.ref == 'refs/heads/master'
run: |
# Push to DockerHub
docker push htrtech/zphisher:latest
# Push to GHCR
docker push ghcr.io/htr-tech/zphisher:latest