This repository has been archived by the owner on Jan 23, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 42
46 lines (44 loc) · 1.57 KB
/
container_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
---
name: Container Image Publishing
on: [workflow_dispatch]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Configure git
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
- name: Extract version
run: |
PKG_VERSION=$(cat VERSION | head -1)
echo "PKG_VERSION=$PKG_VERSION" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
driver-opts: image=moby/buildkit:v0.9.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Build and push image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: "ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:v${{ env.PKG_VERSION }},\
ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:latest"
platforms: linux/amd64,linux/arm64
cache-from: "type=registry,\
ref=ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:latest"
cache-to: type=inline