Extracted canary build to separate workflow

no issue

- by extracting it to a different workflow that uses the
  `workflow_dispatch` trigger, we can manually run a build, but also
  trigger it from Admin so we can always stay up-to-date
This commit is contained in:
Daniel Lockyer 2021-06-01 17:04:16 +01:00
parent f6d67fc92d
commit 84bfbae282
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD
2 changed files with 46 additions and 32 deletions

42
.github/workflows/canary.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Canary Build
on: workflow_dispatch
env:
FORCE_COLOR: 1
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: '14.16.1'
- 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 main
- 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

View File

@ -178,36 +178,8 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Canary name: Canary
steps: steps:
- uses: actions/checkout@v2 - name: Invoke Canary Build
uses: benc-uk/workflow-dispatch@v1
with: with:
fetch-depth: 0 workflow: Canary Build
submodules: true token: ${{ secrets.RELEASE_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: '14.16.1'
- 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
- 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