|
| 1 | +name: Test Build and Deploy |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'feature/changelog' ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + test-build-and-deploy: |
| 9 | + runs-on: ubuntu-18.04 |
| 10 | + env: |
| 11 | + external-doc-build: external_build |
| 12 | + internal-doc-build: internal_build |
| 13 | + zip-doc-build: documents.zip |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Accessing github project files |
| 17 | + uses: actions/checkout@v2 |
| 18 | + |
| 19 | + - name: Build external and internal document |
| 20 | + ## Use our build docker file |
| 21 | + ## Which sets up the ruby env to build the slate template |
| 22 | + uses: ./ |
| 23 | + env: |
| 24 | + EXTERNAL_DOC_BUILD: ${{ env.external-doc-build }} |
| 25 | + INTERNAL_DOC_BUILD: ${{ env.internal-doc-build }} |
| 26 | + ZIP_DOC_BUILD: ${{ env.zip-doc-build }} |
| 27 | + |
| 28 | + # - name: Deploy external documentation |
| 29 | + # uses: peaceiris/[email protected] |
| 30 | + # with: |
| 31 | + # github_token: ${{ secrets.GH_TOKEN }} |
| 32 | + # publish_dir: ${{ env.external-doc-build }} |
| 33 | + # keep_files: false |
| 34 | + |
| 35 | + # - name: Deploy internal documentation |
| 36 | + # uses: peaceiris/[email protected] |
| 37 | + # with: |
| 38 | + # github_token: ${{ secrets.GH_TOKEN }} |
| 39 | + # destination_dir: internal |
| 40 | + # publish_dir: ${{ env.internal-doc-build }} |
| 41 | + # keep_files: false |
| 42 | + |
| 43 | + - name: Get changes from CHANGELOG.md |
| 44 | + id: changelog_reader |
| 45 | + uses: mindsers/changelog-reader-action@v2 |
| 46 | + |
| 47 | + - name: Generate release timestamp |
| 48 | + id: tag |
| 49 | + run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" |
| 50 | + |
| 51 | + - name: Push a tag |
| 52 | + id: push_tag |
| 53 | + uses: mathieudutour/[email protected] |
| 54 | + with: |
| 55 | + github_token: ${{ secrets.GH_TOKEN }} |
| 56 | + custom_tag: ${{ steps.tag.outputs.date }} |
| 57 | + |
| 58 | + - name: Create Release |
| 59 | + id: create_release |
| 60 | + |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
| 63 | + with: |
| 64 | + tag_name: v${{ steps.tag.outputs.date }} |
| 65 | + release_name: ${{ steps.tag.outputs.date }} |
| 66 | + body: ${{ steps.changelog_reader.outputs.changes }} |
| 67 | + prerelease: false |
| 68 | + draft: false |
| 69 | + |
| 70 | + - name: Upload Release Asset |
| 71 | + |
| 72 | + env: |
| 73 | + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
| 74 | + with: |
| 75 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 76 | + asset_path: ./${{ env.zip-doc-build }} |
| 77 | + asset_name: ${{ env.zip-doc-build }} |
| 78 | + asset_content_type: application/zip |
0 commit comments