-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '.github/workflows/' from commit 'cb4016e9691aad2f929fb77e86ed0d0…
…f8bb1534a' git-subtree-dir: .github/workflows git-subtree-mainline: 5cbfa53 git-subtree-split: cb4016e
- Loading branch information
Showing
4 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Docker Github | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: Build image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Docker login | ||
uses: docker/login-action@v4 | ||
with: | ||
registry: docker.pkg.github.com | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.AK }} | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
token: ${{ github.token }} | ||
- name: Docker build | ||
run: | | ||
docker build -t docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest -f docker/engine/Dockerfile . | ||
- name: Docker push latest | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest | ||
- name: Docker push production | ||
if: ${{ github.ref == 'refs/heads/deploy' }} | ||
run: | | ||
docker tag docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:latest docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:production | ||
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/${{ github.event.repository.name }}:production |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Gem | ||
on: | ||
create: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
build: | ||
name: Build + Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch Project | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
token: ${{ github.token }} | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.0 | ||
- name: Publish to RubyGems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${{ secrets.GEM_KEY }}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push *.gem |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Git Collect | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
name: Git Collect | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: work-design/engine | ||
ref: main | ||
submodules: true | ||
token: ${{ secrets.AK }} | ||
- name: Git Pull | ||
run: | | ||
git config user.email '[email protected]' | ||
git config user.name 'Mingyuan Qin With Bot' | ||
git submodule foreach git checkout main | ||
git status | ||
git remote -v | ||
git add . -v | ||
git commit -m ${{ github.event.repository.updated_at }} | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Test | ||
on: [push] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:13 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- name: Fetch Project | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
token: ${{ github.token }} | ||
- name: Set up Ruby and Bundle Install | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.0 | ||
bundler-cache: true | ||
- name: Set up Nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.3 | ||
- name: Cache Node Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: test/dummy/node_modules | ||
key: ${{ runner.OS }}-yarn-${{ hashFiles('test/dummy/yarn.lock') }} | ||
- name: Install Javascript(Node.js) Dependencies | ||
run: | | ||
yarn install --cwd test/dummy --check-files | ||
- name: Prepare DB | ||
run: | | ||
RAILS_ENV=test bin/rails app:db:prepare | ||
RAILS_ENV=test bin/rails g rails_extend:migrations -f | ||
RAILS_ENV=test bin/rails db:migrate | ||
- name: Run Test | ||
run: | | ||
bin/rails test -v -b |