Merge pull request #134 from teikei/chore/content-updates #74
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: 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/[email protected] | |
- uses: actions/[email protected] | |
with: | |
node-version: '16' | |
- 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/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: actions/[email protected] | |
with: | |
node-version: '14' | |
- 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: | |
# The branch to deploy when pushing to Dokku (default: master) | |
branch: master | |
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/master' | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: actions/[email protected] | |
with: | |
node-version: '14' | |
- 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: master | |
ci_branch_name: master | |
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 }} |