Automatic production deployment #219
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: "Automatic production deployment" | |
on: | |
# TODO: Enable CRON if desired | |
# schedule: | |
# # “At 09:00 on every day-of-week from Tuesday through Friday.” | |
# - cron: "0 9 * * 2-5" | |
workflow_dispatch: | |
jobs: | |
backup: | |
runs-on: ubuntu-latest | |
name: Force-push to the production branch | |
steps: | |
- name: sync | |
env: | |
# Requires a Personal Access Token generated by an OSL GitHub org admin | |
# Allows this action to trigger the push-production.yml action | |
# PAT requires the "Read and write" permissions on repository "Contents" | |
# XXX: Expires 23/11/24, see docs here on generating a new one - https://bit.ly/3YNr5sM | |
PERSONAL_ACCESS_TOKEN: ${{ secrets.PROD_DEPLOY_PAT }} | |
run: | | |
set -xe | |
git clone "https://theopensystemslab:${PERSONAL_ACCESS_TOKEN}@github.com/theopensystemslab/planx-new.git" planx-new | |
cd planx-new || exit 1 | |
git push --force origin origin/main:production |