-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (26 loc) · 862 Bytes
/
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
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
push_container:
permissions:
packages: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build and push container-image
run: |
IMAGE_NAME="ghcr.io/simontheleg/semver-tag-from-pr-action"
MAJOR_VERSION=${GITHUB_REF_NAME%%.*}
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
docker build . -t ${IMAGE_NAME}:${GITHUB_REF_NAME}
docker tag ${IMAGE_NAME}:${GITHUB_REF_NAME} ${IMAGE_NAME}:${MAJOR_VERSION}
docker push ${IMAGE_NAME}:${GITHUB_REF_NAME}
docker push ${IMAGE_NAME}:${MAJOR_VERSION}
- name: publish GH release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true