Skip to content

Commit

Permalink
test actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anweiss committed Aug 13, 2019
1 parent 1918105 commit b732f7b
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,54 @@ jobs:
with:
name: build-artifacts

- name: Verify
- name: Comit artifacts
env:
SAXON_VERSION: ${{ matrix.saxon }}
JSON_CLI_VERSION: ${{ matrix.json-cli }}
CICD_DIR: build/ci-cd
OSCAL_REPO_DIR: $GITHUB_WORKSPACE
OSCAL_BUILD_DIR: build-artifacts
OSCAL_TOOLS_DIR: oscal_tools
SCHEMATRON_HOME: git-schematron
TERM: xterm
run: |
ls $PWD
cd "$OSCAL_REPO_DIR"
# Remove existing generated files
git rm -r --ignore-unmatch xml/convert/*.xsl
git rm -r --ignore-unmatch xml/schema/*.xsd
git rm -r --ignore-unmatch json/convert/*.xsl
git rm -r --ignore-unmatch json/schema/*.json
git rm -r --ignore-unmatch content/**/*.xml
git rm -r --ignore-unmatch content/**/*.json
git rm -r --ignore-unmatch content/**/*.yaml
# Copy new built files to repo
cd -
cp -r "$OSCAL_BUILD_DIR"/* "$OSCAL_REPO_DIR"
cd "$OSCAL_REPO_DIR"
# add the new files
git add -f --all xml
git add -f --all json
git add -f --all content
# check for changes
echo "Changed files:"
if ! $(git diff --exit-code --name-only HEAD~1 xml json content); then
# Only deploy if something relevant has changed
# Setup deployment
git config user.name "Deployment Bot"
git commit --allow-empty -m "Deploying content [ci deploy skip]"
# Ensure we are deploying against the latest
git fetch
git rebase origin/master
# deploy
git push
else
echo " No files changed"
fi
- name: Publish build-artifacts
uses: actions/upload-artifact@master
with:
name: build-artifacts
path: build-artifacts

0 comments on commit b732f7b

Please sign in to comment.