Inlined canary build workflow into tests

- this allows us to rely on successful test steps before building a
  canary zip
This commit is contained in:
Daniel Lockyer 2021-01-19 12:10:50 +00:00
parent ab5833182b
commit ff11b42c33
No known key found for this signature in database
GPG Key ID: FFBC6FA2A6F6ABC1
2 changed files with 36 additions and 51 deletions

View File

@ -1,51 +0,0 @@
name: Build
on:
workflow_dispatch:
push:
branches:
- master
jobs:
canary:
runs-on: ubuntu-18.04
name: Canary
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v2
with:
node-version: '12.18.0'
- name: Set up Git
run: |
git config --global pull.rebase true
git config --global user.name "Ghost CI"
git config --global user.email "ghost@example.com"
- run: yarn
- run: grunt master --upstream=origin
- run: echo "ghost_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- run: echo "ghost_admin_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
working-directory: core/client
- run: if [ -n "$(git status --porcelain)" ]; then git add core/client content/themes/casper && git commit -m "Updated Ghost-Admin and Casper"; fi
- run: npm version preminor --preid="pre.$ghost_hash.$ghost_admin_hash"
- run: npm version preminor --preid="pre.$ghost_hash.$ghost_admin_hash"
working-directory: core/client
- run: grunt release --skip-update
- uses: actions/upload-artifact@v2
with:
name: ghost-canary
path: .dist/release/*
retention-days: 7
- uses: actions/upload-artifact@v2
with:
name: ghost-latest
path: .dist/release/*
retention-days: 7

View File

@ -158,3 +158,39 @@ jobs:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
canary:
runs-on: ubuntu-18.04
needs: [lint, migrations, test, ghost-cli]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Canary
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-node@v2
with:
node-version: '12.18.0'
- name: Set up Git
run: |
git config --global pull.rebase true
git config --global user.name "Ghost CI"
git config --global user.email "ghost@example.com"
- run: yarn
- run: grunt master --upstream=origin
- run: echo "ghost_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- run: echo "ghost_admin_hash=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
working-directory: core/client
- run: if [ -n "$(git status --porcelain)" ]; then git add core/client content/themes/casper && git commit -m "Updated Ghost-Admin and Casper"; fi
- run: npm version preminor --preid="pre.$ghost_hash.$ghost_admin_hash"
- run: npm version preminor --preid="pre.$ghost_hash.$ghost_admin_hash"
working-directory: core/client
- run: grunt release --skip-update
- uses: actions/upload-artifact@v2
with:
name: ghost-canary
path: .dist/release/*
retention-days: 7