Skip to content

Commit d5ade1d

Browse files
authored
ci: update release
1 parent 0a446d3 commit d5ade1d

File tree

2 files changed

+34
-41
lines changed

2 files changed

+34
-41
lines changed

.github/workflows/cd.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
build-tag-release:
8+
name: Build, tag, and release Docker image
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v2
13+
- name: Setup release please
14+
uses: google-github-actions/[email protected]
15+
id: release
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
release-type: simple
19+
changelog-path: docs/changelog.md
20+
package-name: streetmerchant
21+
- name: Login into GitHub Container Registry
22+
if: ${{ steps.release.outputs.release_created }}
23+
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
24+
- name: Build Docker image
25+
if: ${{ steps.release.outputs.release_created }}
26+
run: |
27+
docker build \
28+
-t "ghcr.io/${GITHUB_REPOSITORY}:${TAG_NAME}" \
29+
-t "ghcr.io/${GITHUB_REPOSITORY}:latest" .
30+
env:
31+
TAG_NAME: ${{ steps.release.outputs.tag_name }}
32+
- name: Release Docker image
33+
if: ${{ steps.release.outputs.release_created }}
34+
run: docker push "ghcr.io/${GITHUB_REPOSITORY}"

0 commit comments

Comments
 (0)