From 29fa12b300c4eba4af3c6037f5169ebdf8dd9dff Mon Sep 17 00:00:00 2001 From: Cong Date: Fri, 25 Jun 2021 00:27:45 +1000 Subject: [PATCH] Github actions (#1343) --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 27 ----------------------- README.md | 2 +- 3 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..f09c4bd87 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: Build and Deploy +on: [push, pull_request] +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Setup Python + uses: actions/setup-python@v2.2.2 + with: + python-version: '3.7' + + - name: Setup pipenv + run: | + sudo -H pip install -U pipenv + pipenv install + + - name: Build + run: | + make + test 6000 -lt $(cat _build/index.html | wc -l) + yarn install + yarn danger ci + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Before Deploy + run: | + pipenv run htmlmin _build/index.html _build/index.html + + - name: Netlify Actions + # You may pin to the exact commit or the version. + # uses: nwtgck/actions-netlify@f517512ae75beec8896aa7b027c1c72f01816200 + uses: nwtgck/actions-netlify@v1.2.2 + with: + publish-dir: _build + production-deploy: true + github-token: ${{ secrets.GITHUB_TOKEN }} + fails-without-credentials: true + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: 6f222827-83c1-4882-8d4e-6781973be25d + timeout-minutes: 1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01e7b8668..000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -env: - global: - secure: z+UrEQN0U2VBby82vHS2VLElbGDrVTwifRGAEQzFlaARWGig5fRyVSM8Om7ft6z+sk70YXv0mLt3ZyVwvnI/cqULqgoicPav3dplXQyyGyv6FCjiOO8iB8oBZ62wTgmvcYwc5kxnnYVRFaVQsGin/Rm5t1C7YidEYxRXQN0cqtI= - -dist: focal -language: python -cache: pip -python: -- '3.7' -install: -- pip install pipenv -- pipenv install -script: -- make -- test 6000 -lt $(cat _build/index.html | wc -l) -- yarn install -- yarn danger ci - -before_deploy: - - htmlmin _build/index.html _build/index.html - -# NETLIFY_AUTH is in env -deploy: - provider: netlify - edge: true - prod: true - site: 6f222827-83c1-4882-8d4e-6781973be25d diff --git a/README.md b/README.md index edc88211f..52b86f3a4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Open Source Game Clones -[![Build Status](https://travis-ci.com/opengaming/osgameclones.svg?branch=master)](https://travis-ci.com/opengaming/osgameclones) +[![Build and Deploy](https://github.com/opengaming/osgameclones/actions/workflows/main.yml/badge.svg)](https://github.com/opengaming/osgameclones/actions/workflows/main.yml) [![Netlify Status](https://api.netlify.com/api/v1/badges/6f222827-83c1-4882-8d4e-6781973be25d/deploy-status)](https://app.netlify.com/sites/osgameclones/deploys) This is the source of [http://osgameclones.com](http://osgameclones.com).