ci(github-action): Do not push to clojars from dev workflow when not … #16
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
name: Dev | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref_name }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '!release-please-*' | ||
workflow_dispatch: | ||
jobs: | ||
prepare: | ||
name: "Prepare" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Disabling shallow clone is recommended for improving relevancy of reporting for sonar | ||
fetch-depth: 0 | ||
- name: Extract branch name and substitute slashes | ||
shell: bash | ||
working-directory: code | ||
run: | | ||
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | tr '/' '-' >> $GITHUB_ENV | ||
echo "## Checking if string ends with the suffix" | ||
if [[ "$(lein project-version)" == *"${SNAPSHOT}" ]]; then | ||
echo "snapshot=true" >> $GITHUB_ENV | ||
else | ||
echo "snapshot=false" >> $GITHUB_ENV | ||
fi | ||
build: | ||
name: "Build and push" | ||
uses: ./.github/workflows/build.yml | ||
needs: [prepare] | ||
with: | ||
DOCKER_REPO: nuvladev | ||
DOCKER_TAG: ${{ env.branch }} | ||
Check failure on line 41 in .github/workflows/dev.yml GitHub Actions / DevInvalid workflow file
|
||
SNAPSHOT: ${{ env.snapshot }} | ||
secrets: inherit | ||
notify: | ||
if: always() | ||
name: "Notify Slack" | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Gamesight/slack-workflow-status@master | ||
with: | ||
repo_token: ${{secrets.GITHUB_TOKEN}} | ||
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} |