Skip to content

Commit

Permalink
fix(github): allow releases only on master branch
Browse files Browse the repository at this point in the history
  • 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.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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 }}
Expand All @@ -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'
Expand Down

0 comments on commit 769e815

Please sign in to comment.