Skip to content

Commit

Permalink
fix(release): Tags should use version now (#300)
Browse files Browse the repository at this point in the history
* fix(release): Tags should use version now

* Update ci.yml

* Update ci.yml

* Update ci.yml
  • Loading branch information
bagelbits authored Apr 7, 2022
1 parent 2237c14 commit 9660f00
Showing 1 changed file with 12 additions and 27 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
name: 5e SRD API CI/CD

on:
create:
tags:
- 'v*'
push:
branches: [main]
tags:
- 'v*'
pull_request:
branches: [main]
repository_dispatch:
Expand Down Expand Up @@ -65,25 +60,24 @@ jobs:
runs-on: ubuntu-latest
needs: [deploy]
if: github.event_name != 'pull_request'
outputs:
new_release_published: ${{ steps.semantic.outputs.steps.semantic.outputs.new_release_published}}
version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- name: Checkout
- name: Checkout latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm install
- name: Release
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
container-release:
name: Container Release
runs-on: ubuntu-latest
if: github.event_name == 'create'
needs: [github-release]
if: ${{needs.github-release.outputs.new_release_published}} == 'true'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
Expand All @@ -99,20 +93,11 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.github-release.outputs.version }}
labels:
version=${{ needs.github-release.outputs.version }}

0 comments on commit 9660f00

Please sign in to comment.