diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6839e30 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Kiarash Vosough + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/action.yml b/action.yml index e69de29..0f8b8d8 100644 --- a/action.yml +++ b/action.yml @@ -0,0 +1,59 @@ +name: 'Deploy DocC To Github-Pages' +description: 'Deploy DocC generated Static Site To Github-Pages' + +inputs: + docC-generated-static-site-uploaded-name: + description: 'The name of the ziped artifact which was uploaded on previous steps.(artifact must be zipped with .tar extension only)' + required: true + default: 'docC_generated_site_zipped' + +outputs: + docC-page_url: + description: "DocC Deployed Site URL on Github-Pages" + value: ${{ steps.deploy-step.outputs.page_url }} + +runs: + using: "composite" + steps: + - name: checkout + uses: actions/checkout@v3 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + + - name: Download a DocC Generated Static Site Zipped artifact + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.docC-generated-static-site-uploaded-name }} + + - name: Unarchive Artifact + shell: bash + run: | + mkdir ${{ inputs.docC-generated-static-site-uploaded-name }} + tar -xf ${{ inputs.docC-generated-static-site-uploaded-name }}.tar -C ./${{ inputs.docC-generated-static-site-uploaded-name }} + + - name: Build Static Site With Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./${{ inputs.docC-generated-static-site-uploaded-name }} + destination: ./${{ inputs.docC-generated-static-site-uploaded-name }}/__site + + - name: Upload Static Site Artifacts + uses: actions/upload-pages-artifact@v0 + with: + name: github-pages + path: ./${{ inputs.docC-generated-static-site-uploaded-name }}/__site + retention-days: 1 + + - name: Deploy To Pages + id: deploy-step + env: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + uses: actions/deploy-pages@v1 + with: + emit_telemetry: false + timeout: 600000 + error_count: 10 + reporting_interval: 5000 + artifact_name: github-pages