I have an Angular application, source code stored on GitHub. I want to create this pipeline to deploy the code:
- On push anything into the
deploy-test
branch, it starts the workflow. - GitHub will create a runner
- Runner pull the code
- Runner start build process
- Runner create a new git branch, called
deploy-test-build
- Runner push the built files to GitHub repository.
- The self-hosted runner watch the pushes on
deploy-test-build
branch, it starts another workflow.
Here is my first action file:
name: Build test
on:
push:
branches:
- deploy-test
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: deploy-test
- name: Use Node 12.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: |
cd angular
npm ci
- name: Build
run: cd angular && npm run build:ci:test
- name: Publish build
run: |
git config --global user.email "my email"
git config --global user.name my name"
git checkout -b deploy-test-build
git add --force angular/dist
git commit -m "latest build"
git push --force origin deploy-test-build
This has this output on last step:
Run git config --global user.email "my email"
Switched to a new branch 'deploy-test-build'
[deploy-test-build d3fce92] latest build
9 files changed, 1485 insertions(+)
create mode 100644 dist/3rdpartylicenses.txt
create mode 100644 dist/favicon.ico
create mode 100644 dist/index.html
create mode 100644 dist/main.0ac5b66d2bf9e9e9e7ab.js
create mode 100644 dist/polyfills-es5.71ee1b4bd0370b429e7d.js
create mode 100644 dist/polyfills.22c48ffe45b9a56d0593.js
create mode 100644 dist/runtime.eba877d1204fd67b69cb.js
create mode 100644 dist/scripts.7a55fdf6a96cbe55ae9f.js
create mode 100644 dist/styles.18a91683a46b36a985e8.js
To https://github.com/myrepos-name
+ 4298d17...d3fce92 deploy-test-build -> deploy-test-build (forced update)
And the next one:
name: Deploy to test server
on:
push:
branches:
- deploy-test-build
jobs:
prepare:
name: Prepare to clone a new version
runs-on: self-hosted
steps:
# ...
But this last workflow called Deploy to test server
not started.
Any idea how can I fix it?