-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.64 KB
/
docker.yml
File metadata and controls
62 lines (54 loc) · 1.64 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Docker build and push
on:
push:
tags:
- "*"
workflow_dispatch:
env:
REGISTRY: docker.io
IMAGE_NAME: ${{ vars.DOCKER_USER }}/${{ vars.DOCKER_REPO }}
# env:
# REGISTRY: ghcr.io
# IMAGE_NAME: ${{ github.repository }}
jobs:
build-push:
runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker setup buildx
uses: docker/setup-buildx-action@v3
# Log in to the container registry
- name: Docker login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ vars.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# # Extract metadata (tags, labels) for Docker
# - name: Docker metadata action
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.extras
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.ref_name }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max