-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
51 lines (51 loc) · 2.07 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Create release
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
tag_name_no_v: ${{ steps.normalize_tag.outputs.tag_name_no_v }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run release-please
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
changelog-path: CHANGELOG.md
package-name: streetmerchant
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"ci","section":"Continuous Integration","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"refactor","section":"Refactoring","hidden":false},{"type":"perf","section":"Performance","hidden":false},{"type":"test","section":"Tests","hidden":false}]'
- name: Normalize tag name
if: steps.release.outputs.release_created == 'true'
id: normalize_tag
run: |
tag=${{ steps.release.outputs.tag_name }}
echo "tag_name_no_v=${tag#v}" >> "$GITHUB_OUTPUT"
build_tag_publish:
name: Build, tag, and publish
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.release_created == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: "ghcr.io/jef/streetmerchant:latest,ghcr.io/jef/streetmerchant:${{ needs.release.outputs.tag_name_no_v }}"