Skip to content

Commit

Permalink
Add '.github/workflows/' from commit 'cb4016e9691aad2f929fb77e86ed0d0…
Browse files Browse the repository at this point in the history
…f8bb1534a'

git-subtree-dir: .github/workflows
git-subtree-mainline: 5cbfa53
git-subtree-split: cb4016e
  • Loading branch information
qinmingyuan committed Dec 11, 2023
2 parents 5cbfa53 + cb4016e commit 967e3f6
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker_github.yml
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
27 changes: 27 additions & 0 deletions .github/workflows/gempush.yml
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
27 changes: 27 additions & 0 deletions .github/workflows/git.yml
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
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
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

0 comments on commit 967e3f6

Please sign in to comment.