Merge pull request #291 from orionrobots/dependabot/npm_and_yarn/cucu… #327
  
    
      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: Build, test and deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| paths: | |
| - '_posts/**' | |
| - 'content/**' | |
| - 'assets/**' | |
| - 'src/**' | |
| - 'index.md' | |
| - '_includes/**' | |
| - '_data/**' | |
| - '_image_sources/**' | |
| - 'galleries/**' | |
| - 'navigation_and_indexes/**' | |
| - 'products/**' | |
| - '.github/workflows/on_push_to_master_test_and_deploy.yaml' | |
| - '.github/workflows/on_call_build_site.yaml' | |
| - '.github/workflows/on_call_staging_test.yaml' | |
| - 'package.json' | |
| - 'package-lock.json' | |
| - 'webpack.config.js' | |
| - 'favicon.png' | |
| - '.eleventy.*' | |
| - '_config.yml' | |
| - 'google*.html' | |
| - 'ads.txt' | |
| concurrency: | |
| group: site_building | |
| cancel-in-progress: true | |
| jobs: | |
| build_site: | |
| uses: ./.github/workflows/on_call_build_site.yaml | |
| with: | |
| push_tag: "latest" | |
| staging_test: | |
| uses: ./.github/workflows/on_call_staging_test.yaml | |
| needs: build_site | |
| deploy: | |
| concurrency: live_environment | |
| runs-on: ubuntu-latest | |
| needs: staging_test | |
| steps: | |
| - name: Fetch site artifact | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: _site | |
| - name: extract site artifact | |
| run: | | |
| tar -xzf _site.tar.gz | |
| - name: Fetch httpd conf artifact | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| name: httpd.conf | |
| path: .github/scripts/staging/httpd.conf | |
| # Sync the files | |
| - name: Sync the site over | |
| uses: burnett01/rsync-deployments@33214bd98ba4ac2be90f5976672b3f030fce9ce4 # v7.1.0 | |
| with: | |
| switches: -a | |
| path: _site/ | |
| remote_path: public_html | |
| remote_host: home738752777.1and1-data.host | |
| remote_user: ${{ secrets.ORIONROBOTS_DEPLOY_USER }} | |
| remote_key: ${{ secrets.ORIONROBOTS_DEPLOY_KEY }} | |
| # Checks | |
| - name: Check if the site is up | |
| run: | | |
| curl -I -L -f https://orionrobots.co.uk/ | |
| curl -I -L -f https://orionrobots.co.uk/construction_guide.html | |
| curl -I -L -f https://orionrobots.co.uk/wiki/lego | |
| deploy_oauth_config: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Check for workflow changes | |
| # tj-actions/changed-files v44.5.7 | |
| uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 | |
| id: filter | |
| with: | |
| files: | | |
| .github/workflows/** | |
| # see https://github.com/mcdeck/netlify-cms-oauth-provider-php | |
| - name: Checkout the netlify-cms-oauth-provider-php | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: mcdeck/netlify-cms-oauth-provider-php | |
| path: netlify-cms-oauth-provider-php | |
| - name: Perform the netlify composer install | |
| if: steps.filter.outputs.any_changed == 'true' | |
| run: | | |
| cd netlify-cms-oauth-provider-php | |
| composer install | |
| - name: Copy over the netlify-cms-oauth-provider-php files | |
| if: steps.filter.outputs.any_changed == 'true' | |
| uses: burnett01/rsync-deployments@33214bd98ba4ac2be90f5976672b3f030fce9ce4 # v7.1.0 | |
| with: | |
| switches: -a | |
| path: netlify-cms-oauth-provider-php/ | |
| remote_path: github-oauth2 | |
| remote_host: home738752777.1and1-data.host | |
| remote_user: ${{ secrets.ORIONROBOTS_DEPLOY_USER }} | |
| remote_key: ${{ secrets.ORIONROBOTS_DEPLOY_KEY }} | |
| - name: Create the oauth environment file | |
| if: steps.filter.outputs.any_changed == 'true' | |
| run: | | |
| ( | |
| echo "OAUTH_CLIENT_ID=${{ secrets.ORIONROBOTS_OAUTH_CLIENT_ID }}" | |
| echo "OAUTH_CLIENT_SECRET=${{ secrets.ORIONROBOTS_OAUTH_CLIENT_SECRET }}" | |
| echo "REDIRECT_URI=https://github-oauth2.orionrobots.co.uk/callback" | |
| echo "ORIGIN=https://orionrobots.co.uk" | |
| echo "APP_ENV=prod" | |
| ) > netlify-cms-oauth-provider-php/.env.local | |
| - name: Copy over the oauth environment file | |
| if: steps.filter.outputs.any_changed == 'true' | |
| uses: burnett01/rsync-deployments@33214bd98ba4ac2be90f5976672b3f030fce9ce4 # v7.1.0 | |
| with: | |
| switches: -a | |
| path: netlify-cms-oauth-provider-php/.env.local | |
| remote_path: github-oauth2/.env.local | |
| remote_host: home738752777.1and1-data.host | |
| remote_user: ${{ secrets.ORIONROBOTS_DEPLOY_USER }} | |
| remote_key: ${{ secrets.ORIONROBOTS_DEPLOY_KEY }} |