forked from fullstack-hy2020/full-stack-open-pokedex
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (73 loc) · 2.55 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deployment pipeline
env:
SHOULD_DEPLOY: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message), '#skip') }}
on:
push:
branches:
- main
pull_request:
branches: [main]
types: [opened, synchronize]
jobs:
simple_deployment_pipeline:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Install dependencies
run: npm ci
- name: Check style
run: npm run eslint
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Deploy app
if: ${{ env.SHOULD_DEPLOY == 'true' }}
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Notify Discord on success
if: ${{ success() && env.SHOULD_DEPLOY == 'true' }}
uses: stegzilla/discord-notify@v2
with:
title: Deployment succeeded!
message: "**${{ github.event.head_commit.message }}**\n**Creator:** ${{ github.event.head_commit.author.username }}\n${{ github.event.head_commit.url }}"
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
username: 'devserkan'
colour: '#1f883d'
- name: Notify Discord on failure
if: ${{ failure() && env.SHOULD_DEPLOY == 'true' }}
uses: stegzilla/discord-notify@v2
with:
title: Deployment failed!
message: "**${{ github.event.head_commit.message }}**\n**Creator:** ${{ github.event.head_commit.author.username }}\n${{ github.event.head_commit.url }}"
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
username: 'devserkan'
colour: '#d73a49'
tag_release:
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message), '#skip') }}
needs: [simple_deployment_pipeline]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.70.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch