Promote Development Track to Production #5
Workflow file for this run
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
############################################################################## | |
# Instruqt Github Actions Workflow | |
# | |
# This workflow will promote a DEV track back to its PROD version | |
# | |
############################################################################## | |
name: Promote Development Track to Production | |
env: | |
INSTRUQT_TOKEN: ${{ secrets.INSTRUQT_TOKEN }} | |
TRACK_DIR: instruqt | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
inputs: | |
slug: | |
description: Track Slug | |
required: true | |
type: string | |
branches: | |
- '!main' | |
- '!master' | |
jobs: | |
PromoteTrack: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
- name: Pull latest track | |
uses: ./.github/actions/track-pull | |
with: | |
path: ${{ env.TRACK_DIR }}/${{ inputs.slug }} | |
- name: Get Track ID | |
run: echo "ID=$(TRACKNAME=${{ inputs.slug }} yq eval '.tracks[] | select(.slug == env(TRACKNAME) ) | .id' instruqt-tracks/track-slugs.yml)" >> $GITHUB_ENV | |
- name: Update file permissions | |
run: sudo chmod -R a+rwx ${{ env.TRACK_DIR }}/${{ inputs.slug }} | |
- name: Promote dev tracks | |
uses: ./.github/actions/track-promote | |
with: | |
path: ${{ env.TRACK_DIR }}/${{ inputs.slug }} | |
id: ${{ env.ID }} | |
- name: Commit Changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Promoting ${{ inputs.slug }} track |