This repository was archived by the owner on May 20, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 48
69 lines (59 loc) · 2.32 KB
/
Copy pathdev.yml
File metadata and controls
69 lines (59 loc) · 2.32 KB
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
name: Dev
on:
push:
branches: [ develop ]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.6
env:
MYSQL_ROOT_PASSWORD: "changeme123"
MYSQL_DATABASE: "standard_notes_db"
MYSQL_USER: "std_notes_user"
MYSQL_PASSWORD: "changeme123"
ports:
- 3306:3306
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.5
- name: Copy default configuration
run: cp .env.sample .env
- name: Install dependencies
run: bundle install
- name: Setup database
run: bundle exec rails db:create db:migrate
- name: Run tests
run: bundle exec rspec
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Docker buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Publish to Registry
run: |
docker buildx build --push \
--tag standardnotes/syncing-server:dev \
--tag standardnotes/syncing-server:${{ github.sha }} \
--platform linux/amd64,linux/arm64 .
notify_slack:
needs: [ publish ]
runs-on: ubuntu-latest
steps:
- name: Notify slack
uses: pullreminders/slack-action@master
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
args: '{ \"channel\": \"${{ secrets.SLACK_NOTIFICATION_CHANNEL }}\", \"blocks\": [{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"Successfully published <https://syncing-server-dev.standardnotes.org|[DEV] Syncing Server>\"}}, {\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"Changes: <https://github.com/standardnotes/syncing-server/commit/${{ github.sha }}|${{ github.sha }}>\"}, \"accessory\": {\"type\": \"image\", \"image_url\": \"https://website-dev.standardnotes.org/assets/icon.png\", \"alt_text\": \"Standard Notes\"}}, { \"type\": \"section\", \"fields\": [{\"type\": \"mrkdwn\", \"text\": \"<https://github.com/standardnotes/syncing-server/actions/runs/${{ github.run_id }}|Build details>\"}]}]}'