54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
|
name: Build
|
||
|
|
||
|
on:
|
||
|
pull_request:
|
||
|
types: [opened, synchronize, reopened]
|
||
|
push:
|
||
|
branches:
|
||
|
- master
|
||
|
- "*"
|
||
|
- '!gh-pages'
|
||
|
|
||
|
jobs:
|
||
|
build_and_test:
|
||
|
strategy:
|
||
|
fail-fast: false
|
||
|
matrix:
|
||
|
version:
|
||
|
- stable
|
||
|
|
||
|
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
steps:
|
||
|
- uses: actions/checkout@v2
|
||
|
- name: ⚡ Cache
|
||
|
uses: actions/cache@v2
|
||
|
with:
|
||
|
path: |
|
||
|
~/.cargo/registry
|
||
|
~/.cargo/git
|
||
|
target
|
||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||
|
|
||
|
- name: Install ${{ matrix.version }}
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
||
|
profile: minimal
|
||
|
override: true
|
||
|
|
||
|
- name: build
|
||
|
run: make
|
||
|
|
||
|
- name: Login to DockerHub
|
||
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/showcase'
|
||
|
uses: docker/login-action@v1
|
||
|
with:
|
||
|
username: mcaptcha
|
||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
|
||
|
- name: publish docker images
|
||
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/showcase'
|
||
|
run: make docker-publish
|