-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (33 loc) · 1019 Bytes
/
Copy pathdocker.yml
File metadata and controls
39 lines (33 loc) · 1019 Bytes
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
# Manual only: run it from the Actions tab when there is something worth publishing.
name: docker
on:
workflow_dispatch:
inputs:
tag:
description: Image tag to publish
default: latest
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write # what lets GITHUB_TOKEN push to ghcr.io
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- id: image
run: echo "ref=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ steps.image.outputs.ref }}:${{ inputs.tag }}
${{ steps.image.outputs.ref }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max