Publish #87
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
| # This workflow will build a middleman project with bundle | |
| name: Publish | |
| # Controls when the action will run. Workflow runs when manually triggered using the UI | |
| # or API. | |
| on: [ workflow_dispatch ] | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| build_and_release: | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_PAGES_USER: "github-actions" | |
| GH_PAGES_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0 | |
| with: | |
| bundler-cache: true | |
| - name: Set up user in git config | |
| run: | | |
| git config --global user.name "${GH_PAGES_USER}" | |
| git config --global user.email "${GH_PAGES_USER}@github.com" | |
| - name: Configure aws credentials | |
| uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1 | |
| with: | |
| role-to-assume: "${{ secrets.AWS_ROLE_TO_ASSUME }}" | |
| aws-region: "${{ secrets.AWS_REGION }}" | |
| - name: Set up upstream and publish to production gh pages + S3 | |
| env: | |
| REMOTE_NAME: "real" | |
| ALLOW_DIRTY: true | |
| BASE_URL: 'https://www.gocd.org' | |
| DEPLOY_ENVIRONMENT: 'live' | |
| AWS_BUCKET: "${{ secrets.AWS_BUCKET }}" | |
| RUN_EXTERNAL_CHECKS: false | |
| run: | | |
| git remote add real https://${GH_PAGES_USER}:${GH_PAGES_TOKEN}@github.com/gocd/www.go.cd.git | |
| bundle exec rake publish --trace |