Commit 2855fa2d by mingyuan

Add '.github/' from commit 'a6f7cb5e'

git-subtree-dir: .github git-subtree-mainline: 11d64810 git-subtree-split: a6f7cb5e
parents 11d64810 a6f7cb5e
github: ['qinmingyuan']
name: Deploy
on:
push:
branches:
- main
- deploy
jobs:
build:
name: Build image
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v1
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.USER }}
password: ${{ secrets.TOKEN }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Docker build
run: |
docker build -t ${{ secrets.DOCKER_URL }}/$GITHUB_REPOSITORY:latest -f docker/Dockerfile .
- name: Docker push latest
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker push ${{ secrets.DOCKER_URL }}/$GITHUB_REPOSITORY:latest
- name: Docker push production
if: ${{ github.ref == 'refs/heads/deploy' }}
run: |
docker tag ${{ secrets.DOCKER_URL }}/$GITHUB_REPOSITORY:latest ${{ secrets.DOCKER_URL }}/$GITHUB_REPOSITORY:production
docker push ${{ secrets.DOCKER_URL }}/$GITHUB_REPOSITORY:production
name: Gem
on:
pull_request:
branches:
- release
push:
branches:
- release
jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
version: 2.6.x
- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
OWNER: username
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
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@v2
with:
submodules: true
- name: Set up Ruby and Bundle Install
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Set up Nodejs
uses: actions/setup-node@v2
with:
node-version: 16.3.0
- 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: |
test/dummy/bin/yarn install --check-files
- name: Prepare DB
run: |
RAILS_ENV=test bin/rails db:create
RAILS_ENV=test bin/rails g rails_com:migrations -f
RAILS_ENV=test bin/rails db:migrate
- name: Run Test
run: |
bin/rails test -v -b
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment