Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
grid

GitHub Action

Deploy Nightly

v1.2.0

Deploy Nightly

grid

Deploy Nightly

Deploy an asset to a GitHub release with date and commit hash and delete old assets

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Deploy Nightly

uses: WebFreak001/deploy-nightly@v1.2.0

Learn more about this action in WebFreak001/deploy-nightly

Choose a version

deploy-nightly

Deploy a nightly release to a GitHub release. Supports deleting old nightlys and automatically insert a shortened hash + date.

Example

name: Deploy Nightly
on:
  schedule:
    - cron: '0 2 * * *' # run at 2 AM UTC

jobs:
  nightly:
    name: Deploy nightly
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
    runs-on: ${{ matrix.os }}
    steps:
      ... # build your asset first

      - name: Deploy Windows release
        if: matrix.os == 'windows-latest'
        uses: WebFreak001/deploy-nightly@v1.1.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions
        with:
          upload_url: https://uploads.github.com/repos/Pure-D/serve-d/releases/20717582/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
          release_id: 20717582 # same as above (id can just be taken out the upload_url, it's used to find old releases)
          asset_path: ./myapp.zip # path to archive to upload
          asset_name: myapp_windows-nightly-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash
          asset_content_type: application/zip # required by GitHub API
          max_releases: 7 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted