Merge pull request #1 from Hydra-Network/imgbot #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy and Release | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| version: | |
| name: Generate Version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create timestamp version | |
| run: echo "VERSION=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV | |
| deploy: | |
| name: Deploy GitHub Pages | |
| needs: version | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/configure-pages@v5 | |
| - name: Upload site files | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "." | |
| - name: Deploy site | |
| uses: actions/deploy-pages@v4 | |
| release: | |
| name: Update Release | |
| needs: [deploy, version] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create source archives | |
| run: | | |
| git archive --format zip --output source-${{ env.VERSION }}.zip HEAD | |
| git archive --format tar.gz --output source-${{ env.VERSION }}.tar.gz HEAD | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: latest-build | |
| name: "Latest Build" | |
| body: | | |
| Automated release generated from main branch. | |
| Build version: ${{ env.VERSION }} | |
| files: | | |
| index.html | |
| singlefile.html | |
| autoupdate.html | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |