Merge pull request #134 from orionrobots/remove-v #254
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: Build, test and deploy | |
on: | |
push: | |
branches: | |
- master | |
concurrency: | |
group: site_building | |
cancel-in-progress: true | |
jobs: | |
build_site: | |
uses: ./.github/workflows/on_call_build_site.yaml | |
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/[email protected] | |
with: | |
name: _site | |
- name: extract site artifact | |
run: | | |
tar -xzf _site.tar.gz | |
- name: Fetch httpd conf artifact | |
uses: actions/[email protected] | |
with: | |
name: httpd.conf | |
path: _drafts/staging/httpd.conf | |
# Sync the files | |
- name: Sync the site over | |
uses: burnett01/[email protected] | |
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@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
workflows: | |
- '.github/workflows/**' | |
# see https://github.com/mcdeck/netlify-cms-oauth-provider-php | |
- name: Checkout the netlify-cms-oauth-provider-php | |
uses: actions/checkout@v4 | |
with: | |
repository: mcdeck/netlify-cms-oauth-provider-php | |
path: netlify-cms-oauth-provider-php | |
- name: Perform the netlify composer install | |
if: steps.filter.outputs.workflows == 'true' | |
run: | | |
cd netlify-cms-oauth-provider-php | |
composer install | |
- name: Copy over the netlify-cms-oauth-provider-php files | |
if: steps.filter.outputs.workflows == 'true' | |
uses: burnett01/[email protected] | |
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.workflows == 'true' | |
run: | | |
echo "OAUTH_CLIENT_ID=${{ secrets.ORIONROBOTS_OAUTH_CLIENT_ID }}" > netlify-cms-oauth-provider-php/.env.local | |
echo "OAUTH_CLIENT_SECRET=${{ secrets.ORIONROBOTS_OAUTH_CLIENT_SECRET }}" >> netlify-cms-oauth-provider-php/.env.local | |
echo "REDIRECT_URI=https://github-oauth2.orionrobots.co.uk/callback" >> netlify-cms-oauth-provider-php/.env.local | |
echo "ORIGIN=https://orionrobots.co.uk" >> netlify-cms-oauth-provider-php/.env.local | |
echo "APP_ENV=prod" >> netlify-cms-oauth-provider-php/.env.local | |
- name: Copy over the oauth environment file | |
if: steps.filter.outputs.workflows == 'true' | |
uses: burnett01/[email protected] | |
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 }} |