Skip to content

Commit

Permalink
Avoid force push
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro committed Aug 17, 2020
1 parent 8254384 commit 85b4ca1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 53 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/main.yml

This file was deleted.

30 changes: 17 additions & 13 deletions .github/workflows/examples.yml → .github/workflows/publish.yml
@@ -1,4 +1,4 @@
name: Examples
name: Publish

on: [push, pull_request]

Expand All @@ -10,36 +10,40 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Compile Skill model
uses: docker://sailavid/ua-modelcompiler
with:
entrypoint: /bin/bash
args: -c "cd /app && /app/PublishModel.sh /github/workspace/SkillsModel Opc.Ua.Skills /github/workspace/Published
args: -c "cd /app && /app/PublishModel.sh /github/workspace/SkillsModel Opc.Ua.Skills /github/workspace/Published/Skills
- name: Compile Example.LinearAxisWithGripper
uses: docker://sailavid/ua-modelcompiler
with:
entrypoint: /bin/bash
args: -c "cd /app && /app/PublishModel.sh /github/workspace/exampleModel/LinearAxisWithGripperModel Example.LinearAxisWithGripper /github/workspace/Examples"
args: -c "cd /app && /app/PublishModel.sh /github/workspace/exampleModel/LinearAxisWithGripperModel Example.LinearAxisWithGripper /github/workspace/Published/LinearAxisWithGripper"
- name: Upload compiled model
uses: actions/upload-artifact@v1
with:
name: Examples
path: Examples
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
name: Published
path: Published
- name: Commit files
if: steps.extract_branch.outputs.branch == 'master'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
mv Published Published-new
git checkout ${{ steps.extract_branch.outputs.branch }}-published
git merge -X theirs -m"Merge changes from ${{ steps.extract_branch.outputs.branch }}" ${{ steps.extract_branch.outputs.branch }}
rm -rf Published
mv Published-new Published
git add -f ${GITHUB_WORKSPACE}/Published/*
git add -f ${GITHUB_WORKSPACE}/Examples/*
git commit -m "[skip ci] Deploy from GitHub Action" -a
- name: Push compiled model to examples branch
- name: Push compiled model to published branch
if: steps.extract_branch.outputs.branch == 'master'
uses: ad-m/github-push-action@master
with:
branch: ${{ steps.extract_branch.outputs.branch }}-examples
force: true
branch: ${{ steps.extract_branch.outputs.branch }}-published
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -27,7 +27,7 @@ The `master` branch only contains the `*Model.xml` files, not the compiled NodeS
On every push to a branch, an is executed and the resultin model files are pushed back to the branch 'master-published'.

Have a look at the resulting files here:
https://github.com/opcua-skills/skill-nodeset/tree/master-examples/Published
https://github.com/opcua-skills/skill-nodeset/tree/master-published/Published

If you like to manually build the files on your machine, follow these steps:

Expand Down

0 comments on commit 85b4ca1

Please sign in to comment.