Skip to content

♻️ refactor: update docs #2 #20

♻️ refactor: update docs #2

♻️ refactor: update docs #2 #20

Workflow file for this run

# This GitHub Actions workflow is designed to run on pushes to the master branch and on pull requests.
# It builds the project, runs tests, and deploys a release when a tag is pushed.
# It also checks if the tag exists before creating a release.
# The workflow uses the softprops/action-gh-release action to create a GitHub release.
name: GH Workflow Base
on:
push:
branches: ["master"]
tags:
- "v*"
pull_request:
branches: ["master"]
jobs:
# This job runs on pushes to the master branch and pull requests.
# It checks out the repository, installs dependencies, and runs tests.
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
echo "Dependencies here"
- name: Run tests
run: |
echo "Test commands here"
# This job runs on pushes to the master branch and pull requests.
# It checks out the repository, installs dependencies, and runs tests.
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure all history is fetched
- name: Check if tag exists
id: check_tag
run: |
if [ -n "$GITHUB_REF" ]; then
TAG=${GITHUB_REF#refs/tags/}
# echo "::set-output name=tag::$TAG"
echo "TAG=${TAG}" >> $GITHUB_ENV
else
# echo "::set-output name=tag::"
echo "TAG=" >> $GITHUB_ENV
fi
shell: bash
- name: Install dependencies
run: |
echo "Dependencies here"
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1 # uses: actions/create-release@v1
with:
tag_name: ${{ env.TAG }}
body: |
:gem: released new version ${{ env.TAG }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}