Release #855
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: Release | |
on: | |
schedule: | |
- cron: '0 4 * * 1-5' | |
jobs: | |
release: | |
name: 'Release & Publish' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
# pulls all commits (needed for semantic release to correctly version) | |
fetch-depth: 0 | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Pull all tags | |
# pulls all tags (needed for semantic release to correctly version) | |
run: git fetch --all --tags | |
- name: Set up environment | |
uses: ./.github/actions/prepare-environment | |
- name: Get version before release step | |
id: initversion | |
run: | | |
echo "::set-output name=version::$(git describe --tags $(git rev-list --tags --max-count=1))" | |
- name: Create a Release | |
run: npx semantic-release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get version following release step | |
id: postversion | |
run: | | |
echo "::set-output name=version::$(git describe --tags $(git rev-list --tags --max-count=1))" | |
- name: Publish Site | |
if: steps.initversion.outputs.version != steps.postversion.outputs.version | |
run: | | |
curl -X POST -d {} ${{ secrets.TIMELINE_TOKEN }} | |
- name: Send notification on failure | |
if: failure() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | |
uses: Royal-Navy/design-system-slacknotify-action@master | |
with: | |
channel_id: ${{ secrets.CHANNEL_ID }} | |
status: FAILED | |
color: danger |