-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (45 loc) · 1.34 KB
/
publish-image.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
48
49
50
---
name: Publish Docker image
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
pull_request:
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- uses: rlespinasse/[email protected]
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Publish
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
tags: |
ghcr.io/rakutentech/plantuml:${{ env.GITHUB_REF_SLUG }}
ghcr.io/rakutentech/plantuml:${{ env.GITHUB_SHA_SHORT }}
secrets: |
GIT_AUTH_TOKEN=${{ github.token }}