Publish Channel (nightly) #1411
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: Publish Channel (nightly) | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Publish 1 hour after nightlies start building | |
| - cron: '0 1 * * *' | |
| env: | |
| NIGHTLY_CHANNEL_DIR: ./channel-fuel-nightly.toml.d/ | |
| RUST_VERSION: 1.85.0 | |
| jobs: | |
| publish-channel: | |
| name: Publish channel (nightly) | |
| runs-on: ubuntu-latest | |
| environment: fuelup-bot | |
| steps: | |
| - name: checkout master | |
| uses: actions/checkout@v3 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| - name: Install build-channel script | |
| run: cargo install --locked --debug --path ./ci/build-channel | |
| - name: Publish nightly channel | |
| id: setup | |
| run: | | |
| PUBLISHED_DATE=$(date +'%Y-%m-%d') | |
| FORMATTED_PUBLISHED_DATE=$(date +'%Y/%m/%d') | |
| mkdir -p ${{ env.NIGHTLY_CHANNEL_DIR }} | |
| CHANNEL_TOML="channel-fuel-nightly.toml" | |
| build-channel --nightly $CHANNEL_TOML $PUBLISHED_DATE --github-run-id $GITHUB_RUN_ID | |
| cp $CHANNEL_TOML ${{ env.NIGHTLY_CHANNEL_DIR }} | |
| echo "::set-output name=archive_dir::channels/nightly/${FORMATTED_PUBLISHED_DATE}" | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.APP_KEY }} | |
| - name: Deploy nightly channel (latest version) | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| publish_dir: ${{ env.NIGHTLY_CHANNEL_DIR }} | |
| keep_files: true | |
| destination_dir: ./ | |
| user_name: 'fuel-service-user' | |
| user_email: 'fuel-service-user@users.noreply.github.com' | |
| - name: Deploy nightly channel (archive) | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| publish_dir: ${{ env.NIGHTLY_CHANNEL_DIR }} | |
| keep_files: true | |
| destination_dir: ${{ steps.setup.outputs.archive_dir }} | |
| user_name: 'fuel-service-user' | |
| user_email: 'fuel-service-user@users.noreply.github.com' | |
| notify-slack-on-failure: | |
| if: failure() | |
| needs: [publish-channel] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ravsamhq/notify-slack-action@v1 | |
| with: | |
| status: 'failure' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| notification_title: '{workflow} has {status_message}' | |
| message_format: '{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>' | |
| footer: '' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }} |