Skip to content

Update to node 20. (#148) #79

Update to node 20. (#148)

Update to node 20. (#148) #79

Workflow file for this run

name: Ernte Teilen Site CI
concurrency: ci-${{ github.ref }}
on:
push:
branches:
- '*'
- '!dependabot/**'
workflow_dispatch:
env:
HUSKY: 0
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.9.0'
- name: Install dependencies
working-directory: ./
run: npm ci
- name: Code linting
working-directory: ./
run: npm run lint
- name: Run Tests
working-directory: ./
run: npm test
# - name: Run Web Tests
# working-directory: ./
# run: yarn cypress:run
- name: Notify slack success
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: SUCCESS
color: good
message_id: ${{ steps.slack.outputs.message_id }}
- name: Notify slack fail
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: FAILED
color: danger
message_id: ${{ steps.slack.outputs.message_id }}
deploy-preview:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/preview'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '20.9.0'
- name: Notify slack started
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
id: slack
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: STARTED
color: good
- name: Install dependencies
working-directory: ./
run: npm ci
- name: Deploy Preview
uses: dokku/[email protected]
with:
branch: main
ci_branch_name: preview
ssh_private_key: ${{ secrets.DOKKU_SSH_KEY }}
git_remote_url: ssh://dokku@${{ secrets.DOKKU_HOST }}:22/teikei-site-preview
- name: Notify slack success
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: SUCCESS
color: good
message_id: ${{ steps.slack.outputs.message_id }}
- name: Notify slack fail
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: FAILED
color: danger
message_id: ${{ steps.slack.outputs.message_id }}
deploy-production:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '20.9.0'
- name: Notify slack started
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
id: slack
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: STARTED
color: good
- name: Install dependencies
working-directory: ./
run: npm ci
- name: Deploy Production
uses: dokku/[email protected]
with:
branch: main
ci_branch_name: main
ssh_private_key: ${{ secrets.DOKKU_SSH_KEY }}
git_remote_url: ssh://dokku@${{ secrets.DOKKU_HOST }}:22/teikei-site
- name: Notify slack success
if: success()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: SUCCESS
color: good
message_id: ${{ steps.slack.outputs.message_id }}
- name: Notify slack fail
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: teikei-notifications
status: FAILED
color: danger
message_id: ${{ steps.slack.outputs.message_id }}