-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.23 KB
/
release.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
51
52
name: Release
env:
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
on:
workflow_run:
workflows: [ CI ]
branches: [ main ]
types:
- completed
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
driver: docker-container
- name: Convert repo-name to lowercase
run: |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Log into registry GHCR
if: success()
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to ghcr.io
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: ${{ env.platforms }}
push: true
tags: ghcr.io/${{ env.REPOSITORY }}:latest
cache-from: type=gha
cache-to: type=gha