-
Notifications
You must be signed in to change notification settings - Fork 17
47 lines (38 loc) · 1.2 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
name: Release
on:
release:
types: [published]
env:
DOCKERHUB_REPOSITORY: weseek/mongodb-awesome-backup
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get SemVer
run: |
SEMVER=`git tag | sed -E 's/^v//'`
echo "SEMVER=$SEMVER" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: crazy-max/[email protected]
with:
version: v0.3.1
- name: Login to docker.io registry
run: >
echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} |
docker login --username ${{ secrets.DOCKER_REGISTRY_USERNAME }} --password-stdin
- name: Build and push latest Docker Image
run: >
docker buildx build
--tag ${DOCKERHUB_REPOSITORY}
--platform linux/amd64
--cache-from type=registry,ref=${DOCKERHUB_REPOSITORY}
--load
.
- name: Tagging Docker Image by SemVer and publish
uses: weseek/[email protected]
with:
source: ${{ env.DOCKERHUB_REPOSITORY }}
target: ${{ env.DOCKERHUB_REPOSITORY }}
semver: ${{ env.SEMVER }}
publish: true