-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(github): allow releases only on master branch
- Loading branch information
Tomasz Gągor
committed
Mar 16, 2021
1 parent
6f84b6d
commit 769e815
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Build the Docker image | ||
- name: Build, squash and push | ||
run: | | ||
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
docker build --tag ghcr.io/tgagor/centos-stream --cache-from ghcr.io/tgagor/centos-stream . | ||
|
@@ -30,13 +30,15 @@ jobs: | |
docker push ghcr.io/tgagor/centos-stream | ||
docker push ghcr.io/tgagor/centos-stream:${GITHUB_REF##*/} | ||
- name: SemVer bump version and push tag | ||
- name: Bump version and push tag | ||
if: github.ref == 'refs/heads/master' | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create normal GitHub release | ||
if: github.ref == 'refs/heads/master' | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -46,8 +48,8 @@ jobs: | |
body: ${{ steps.tag_version.outputs.changelog }} | ||
|
||
- name: Get current date | ||
id: date | ||
if: github.event_name == 'schedule' | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
- name: Create a weekly GitHub release | ||
if: github.event_name == 'schedule' | ||
|