-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (53 loc) · 1.45 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
48
49
50
51
52
53
54
name: Publish Docker image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]-beta.[0-9]+'
paths-ignore:
- "**/docs/**"
- "**.md"
jobs:
docker:
runs-on: ubuntu-latest
env:
DOCKERHUB_USER: cargogenerate
DOCKERHUB_IMAGE: cargo-generate-action
steps:
# Check out code
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{env.DOCKERHUB_USER}}/${{env.DOCKERHUB_IMAGE}}
tags: type=semver,pattern={{version}}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# And make it available for the builds
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
labels: |
rust
cargo
cargo-generate
tags: ${{ steps.meta.outputs.tags }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Latest Release
prerelease: false
draft: false