-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.25 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
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- id: short-sha
run: |
echo "tag=$(echo "${{ github.sha }}" | cut -c1-7)" >> "$GITHUB_OUTPUT"
- id: tag
run: |
echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT"
if: startsWith(github.ref, 'refs/tags/')
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: lowerify repository name
id: lowerify
run: |
echo "repository=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: build and push
uses: docker/bake-action@v3
with:
files: docker-bake.hcl
push: true
load: false
set: |
server.cache-from=type=gha
server.cache-to=type=gha,mode=max
env:
TAG: ${{ steps.short-sha.outputs.tag }}
IMAGE_NAME: ghcr.io/${{ steps.lowerify.outputs.repository }}
RELEASE: ${{ steps.tag.outputs.tag }}