-
Notifications
You must be signed in to change notification settings - Fork 8
43 lines (36 loc) · 1.06 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
name: build docker
on:
push:
tags:
- v*
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to coding registry
uses: docker/login-action@v2
with:
registry: bangbang93-docker.pkg.coding.net
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract Git Tag
run: echo "GIT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
env:
IMAGE_TAG: ${{ env.GIT_TAG }}
IMAGE_NAME: bangbang93-docker.pkg.coding.net/mirrors/bangbang93/lmbtfy-cn
with:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}