-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (41 loc) · 1.52 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
43
44
45
46
47
48
name: Docker
on:
push:
tags:
- v*
env:
IMAGE_NAME: ghcr.io/sushiibot/sushii-image-server
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ env.IMAGE_NAME }}
tag-match: '\d{1,3}.\d{1,3}.\d{1,3}'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push image to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=registry,ref=${ env.IMAGE_NAME }:latest
cache-to: type=inline
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.set_tags.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}