-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.14 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
name: Docker
on:
push:
branches-ignore: [ "dev*", "next", "nightly*" ]
tags: [ "v*.*.*" ]
workflow_dispatch:
env:
REGISTRY: hub.docker.com
IMAGE_TAG: latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: buildx
run: docker buildx build --tag ${{ secrets.DOCKERHUB_USERNAME }}/contained:latest .
- name: cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-buildx-${{ github.sha }}
path: /tmp/.buildx-cache
restore-keys: |
${{ runner.os }}-buildx-${{ github.sha }}
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get cache
uses: actions/cache@v4
with:
key: ${{ runner.os }}-buildx-${{ github.sha }}
path: /tmp/.buildx-cache
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
dockerfile: Dockerfile
name: ${{ secrets.DOCKERHUB_USERNAME }}/contained
password: ${{ secrets.DOCKERHUB_TOKEN }}
snapshot: true
username: ${{ secrets.DOCKERHUB_USERNAME }}