Publish Channel (nightly) #835
This file contains 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/ | |
jobs: | |
publish-channel: | |
name: Publish channel (nightly) | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout master | |
uses: actions/checkout@v3 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install build-channel script | |
run: cargo install --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}" | |
- name: Deploy nightly channel (latest version) | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.REPO_TOKEN }} | |
publish_dir: ${{ env.NIGHTLY_CHANNEL_DIR }} | |
keep_files: true | |
destination_dir: ./ | |
user_name: 'fuel-service-user' | |
user_email: '[email protected]' | |
- name: Deploy nightly channel (archive) | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.REPO_TOKEN }} | |
publish_dir: ${{ env.NIGHTLY_CHANNEL_DIR }} | |
keep_files: true | |
destination_dir: ${{ steps.setup.outputs.archive_dir }} | |
user_name: 'fuel-service-user' | |
user_email: '[email protected]' | |
- name: Notify if Job Fails | |
uses: ravsamhq/notify-slack-action@v1 | |
with: | |
status: ${{ job.status }} | |
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: "" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }} |