Skip to content

Commit

Permalink
style:ci bash create user,db
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang committed Dec 18, 2021
1 parent 7ae9ee3 commit ca4a6d3
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,20 @@ jobs:
- name: Run Linter
run: golangci-lint run --timeout=10m -v --disable-all --enable=govet --enable=staticcheck --enable=ineffassign --enable=misspell

- name: Shutdown Ubuntu MySQL (SUDOx)
run: sudo service mysql stop

- name: Set Up MySQL
uses: mirromutth/[email protected]
with:
host port: ${{ secrets.MYSQL_PORT }}
container port: 3307
character set server: 'utf8mb4'
collation server: 'utf8mb4_unicode_ci'
mysql version: ${{ secrets.MYSQL_VERSION }}
mysql user: ${{ secrets.MYSQL_USER_NAME }}
mysql password: ${{ secrets.MYSQL_PWD }}

- name: Restart MySQL
run: sudo service mysql restart

- name: Create user and database
shell: bash
run: |
mysql -uroot -proot <<EOF
use mysql
create user ${{ secrets.MYSQL_USER_NAME }}@127.0.0.1 identified by '${{ secrets.MYSQL_PWD }}';
create database employees;
GRANT ALL ON employees.* to ${{ secrets.MYSQL_USER_NAME }}@127.0.0.1;
flush privileges;
EOF
- name: Import mysql sql
shell: bash
run: |
Expand Down

0 comments on commit ca4a6d3

Please sign in to comment.