-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 1.88 KB
/
Copy pathdocker.yaml
File metadata and controls
64 lines (57 loc) · 1.88 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
63
64
name: Docker
on:
push:
branches: [master, main]
paths-ignore:
- '**/*.md'
pull_request:
branches: [master, main]
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/binarygeek119/channelflow
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=
- uses: docker/build-push-action@v7
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
CHANNELFLOW_VERSION=1.0.0
CHANNELFLOW_REVISION=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Check GHCR package visibility
if: github.event_name != 'pull_request'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
visibility=$(gh api \
-H "Accept: application/vnd.github+json" \
"/users/${{ github.repository_owner }}/packages/container/channelflow" \
--jq .visibility)
echo "GHCR package visibility: ${visibility}"
if [ "${visibility}" != "public" ]; then
echo "::warning::GitHub has no API to change GHCR visibility. Set the package to Public at https://github.com/${{ github.repository_owner }}?tab=packages"
fi