Skip to content

ci: bump cycjimmy/semantic-release-action from 4.1.0 to 4.1.1 (#875) #313

ci: bump cycjimmy/semantic-release-action from 4.1.0 to 4.1.1 (#875)

ci: bump cycjimmy/semantic-release-action from 4.1.0 to 4.1.1 (#875) #313

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
branches:
- master
jobs:
semantic-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: |
npm ci
npm run lint
npm test
- name: Semantic Release
uses: cycjimmy/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
with:
extra_plugins: |
@eclass/semantic-release-sentry-releases
@semantic-release/git
@semantic-release/changelog
@semantic-release/exec
- name: Read .release file
id: release
run: echo "::set-output name=release::$(cat .release)"
- name: Create Sentry release
if: ${{ steps.release.outputs.release == 'yes' }}
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
# Built from https://blog.benoitblanchon.fr/github-action-run-ssh-commands/
- name: Configure
if: ${{ steps.release.outputs.release == 'yes' }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/prod.key
chmod 600 ~/.ssh/prod.key
cat >>~/.ssh/config <<END
Host bot
HostName $SSH_BOT_HOST
Port $SSH_BOT_PORT
User $SSH_USER
IdentityFile ~/.ssh/prod.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.SSH_USER }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_BOT_HOST: ${{ secrets.SSH_BOT_HOST }}
SSH_BOT_PORT: ${{ secrets.SSH_BOT_PORT }}
DEPLOY_BRANCH: ${{ secrets.DEPLOY_BRANCH }}
- name: Stop Bot Process
if: ${{ steps.release.outputs.release == 'yes' }}
run: ssh bot 'source ~/.zshrc && cd ${{ secrets.DEPLOY_DIR }} && { make -f docker.Makefile down_prod } || echo "Nothing to stop"'
- name: Update Containers
if: ${{ steps.release.outputs.release == 'yes' }}
run: ssh bot 'source ~/.zshrc && cd ${{ secrets.DEPLOY_DIR }} && make -f docker.Makefile submod bot notifier'
- name: Restart Containers
if: ${{ steps.release.outputs.release == 'yes' }}
run: ssh bot 'source ~/.zshrc && cd ${{ secrets.DEPLOY_DIR }} && make -f docker.Makefile up_prod'