Snapshot upstream #110
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: Snapshot upstream | |
| on: | |
| schedule: | |
| - cron: '0 0,12 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: 'snapshot-upstream' | |
| cancel-in-progress: true | |
| jobs: | |
| snapshot-update: | |
| runs-on: ubuntu-latest | |
| env: | |
| sed_string: 's/getting-started__/link-/;/Size:/d;/Instances!/d' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update upstream CSS 0 | |
| run: | | |
| cd css/upstream | |
| curl -sL https://34.si/330/0.css -o 0.css.new | |
| perl -pe 's/\.compose.+?(?:\})//'<0.css.new | sed $sed_string > 0.css | |
| rm 0.css.new | |
| - name: Update upstream CSS 1 | |
| run: | | |
| cd css/upstream | |
| curl -sL https://34.si/330/1.css -o 1.css.new | |
| perl -pe 's/\.compose.+?(?:\})//'<1.css.new | sed $sed_string > 1.css | |
| rm 1.css.new | |
| - name: Update upstream CSS 2 | |
| run: | | |
| cd css/upstream | |
| curl -sL https://34.si/330/2.css -o 2.css.new | |
| perl -pe 's/\.compose.+?(?:\})//'<2.css.new | sed $sed_string > 2.css | |
| rm 2.css.new | |
| - name: Update upstream CSS 3 | |
| run: | | |
| cd css/upstream | |
| curl -sL https://34.si/330/3.css -o 3.css.new | |
| perl -pe 's/\.compose.+?(?:\})//'<3.css.new | sed $sed_string > 3.css | |
| rm 3.css.new | |
| - name: Commit changes | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: devops-infra/action-commit-push@master | |
| with: | |
| github_token: "${{ secrets.GITHUB_TOKEN }}" | |
| commit_prefix: "[Workflow Commit] " | |
| commit_message: "Updated upstream CSS" | |
| - name: Check output | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| head css/upstream/{0,1,2,3}.css | |
| tail css/upstream/{0,1,2,3}.css | |
| post-snapshot-upstream: | |
| needs: snapshot-update | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: 'CompostInTraining', | |
| repo: 'InstanceTickerCiT', | |
| workflow_id: 'deploy.yml', | |
| ref: 'master' | |
| }) |