-
-
Notifications
You must be signed in to change notification settings - Fork 53
33 lines (29 loc) · 1.12 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
name: Publish Docker image
on:
release:
types: [published]
workflow_dispatch:
env:
REGISTRY: "registry-1.docker.io"
REPO: "dnsmonster"
jobs:
path-context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: azure/docker-login@v2
with:
login-server: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build ${{ env.REPO }}
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: ${{ env.REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ env.REPO }}:latest
- run: docker tag ${{ env.REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ env.REPO }}:latest ${{ env.REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ env.REPO }}:${GITHUB_REF##*/}
- run: docker push ${{ env.REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ env.REPO }}:latest
- run: docker push ${{ env.REGISTRY }}/${{ secrets.DOCKER_USERNAME }}/${{ env.REPO }}:${GITHUB_REF##*/}