|
| 1 | +name: Publish Branch Examples |
| 2 | + |
| 3 | +on: push |
| 4 | + |
| 5 | +jobs: |
| 6 | + publish-examples: |
| 7 | + name: Publish Examples |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + |
| 12 | + - uses: actions/setup-node@v1 |
| 13 | + with: |
| 14 | + node-version: '12' |
| 15 | + |
| 16 | + - uses: actions/setup-java@v1 |
| 17 | + with: |
| 18 | + java-version: 1.8 |
| 19 | + |
| 20 | + - uses: DeLaGuardo/setup-clojure@3.2 |
| 21 | + with: |
| 22 | + cli: 1.10.1.693 |
| 23 | + |
| 24 | + - name: Get yarn cache directory path |
| 25 | + id: yarn-cache-dir-path |
| 26 | + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" |
| 27 | + |
| 28 | + - name: Cache yarn packages |
| 29 | + uses: actions/cache@v2 |
| 30 | + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) |
| 31 | + with: |
| 32 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 33 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ runner.os }}-yarn- |
| 36 | +
|
| 37 | + - name: Cache maven packages |
| 38 | + uses: actions/cache@v2 |
| 39 | + with: |
| 40 | + path: ~/.m2 |
| 41 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 42 | + restore-keys: ${{ runner.os }}-m2 |
| 43 | + |
| 44 | + - name: Cache shadow-cljs |
| 45 | + uses: actions/cache@v2 |
| 46 | + with: |
| 47 | + path: .shadow-cljs |
| 48 | + key: ${{ runner.os }}-shadow-cljs-${{ hashFiles('**/pom.xml') }} |
| 49 | + restore-keys: ${{ runner.os }}-shadow-cljs |
| 50 | + |
| 51 | + - run: yarn install --frozen-lockfile |
| 52 | + |
| 53 | + - run: yarn shadow-cljs release dev |
| 54 | + |
| 55 | + - name: Extract branch name |
| 56 | + shell: bash |
| 57 | + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" |
| 58 | + id: extract_branch |
| 59 | + |
| 60 | + - name: Publish to GitHub Pages 🚀 |
| 61 | + uses: JamesIves/github-pages-deploy-action@4.1.0 |
| 62 | + with: |
| 63 | + branch: gh-pages |
| 64 | + folder: public |
| 65 | + target-folder: branches/${{ steps.extract_branch.outputs.branch }} |
| 66 | + |
| 67 | + - name: Slack Notification |
| 68 | + uses: rtCamp/action-slack-notify@v2 |
| 69 | + env: |
| 70 | + SLACK_CHANNEL: proj-dev-homebase-react |
| 71 | + SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' |
| 72 | + SLACK_ICON: https://github.com/homebaseio.png?size=200 |
| 73 | + SLACK_MESSAGE: "- :github: Branch: <https://github.com/homebaseio/homebase-react/tree/${{ steps.extract_branch.outputs.branch }}|${{ steps.extract_branch.outputs.branch }}>\n- :card_file_box: devcards: https://homebaseio.github.io/homebase-react/branches/${{ steps.extract_branch.outputs.branch }}/index.html" |
| 74 | + SLACK_TITLE: "Published ${{ steps.extract_branch.outputs.branch }} to GitHub Pages :rocket:" |
| 75 | + SLACK_USERNAME: Homebase |
| 76 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |
0 commit comments