From b7edb9955935bb72f54905eff17f5161f2b25ce6 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 16 May 2025 17:00:01 +0100 Subject: [PATCH 1/2] Removing duplicate deploy and updates --- .github/workflows/live.yml | 2 +- .github/workflows/master.yml | 70 ----------------------------------- .github/workflows/preview.yml | 2 +- 3 files changed, 2 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/master.yml diff --git a/.github/workflows/live.yml b/.github/workflows/live.yml index 2f0b8a2..c041aa0 100644 --- a/.github/workflows/live.yml +++ b/.github/workflows/live.yml @@ -24,7 +24,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index df4f656..0000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,70 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Deploy-guides - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch -on: - push: - branches: - - main -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - run: gem install bundler - - - uses: actions/cache@v1 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - # Build jekyll site - - name: Build Jekyll - run: .github/bin/build_jekyll.sh - env: - CONFIG: "--config _config.yml,_config_prod.yml" - - # Deploy to live site - - name: Create GitHub deployment - uses: glenrobson/deployments@v0.4.2 - id: deployment - with: - step: start - token: ${{ secrets.GITHUB_TOKEN }} - auto_inactive: 'false' - env: production - - name: Deploy to S3 - uses: glenrobson/s3-sync-action@v0.5.1 - with: - args: --acl public-read --cache-control max-age=0,public - env: - AWS_S3_BUCKET: "iiif-guides" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - SOURCE_DIR: "_site" - - name: Update deployment status - uses: glenrobson/deployments@v0.4.2 - if: always() - with: - step: finish - auto_inactive: 'false' - token: ${{ secrets.GITHUB_TOKEN }} - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} - env_url: "https://guides.iiif.io" diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 85f8eda..9e15fdc 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -23,7 +23,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Export BRANCH_NAME # store branch name in $BRANCH_NAME run: echo BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV From a536f72b4735e4d01fbf733fd863c1857b4e4b10 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 16 May 2025 17:04:22 +0100 Subject: [PATCH 2/2] We do need to deploy to guides too --- .github/workflows/guides.yml | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/guides.yml diff --git a/.github/workflows/guides.yml b/.github/workflows/guides.yml new file mode 100644 index 0000000..f6fbcd5 --- /dev/null +++ b/.github/workflows/guides.yml @@ -0,0 +1,70 @@ +# This is a basic workflow to help you get started with Actions + +name: Deploy-guides + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the main branch +on: + push: + branches: + - main +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - run: gem install bundler + + - uses: actions/cache@v4 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-gems- + + # Build jekyll site + - name: Build Jekyll + run: .github/bin/build_jekyll.sh + env: + CONFIG: "--config _config.yml,_config_prod.yml" + + # Deploy to live site + - name: Create GitHub deployment + uses: glenrobson/deployments@v0.4.2 + id: deployment + with: + step: start + token: ${{ secrets.GITHUB_TOKEN }} + auto_inactive: 'false' + env: production + - name: Deploy to S3 + uses: glenrobson/s3-sync-action@v0.5.1 + with: + args: --acl public-read --cache-control max-age=0,public + env: + AWS_S3_BUCKET: "iiif-guides" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + SOURCE_DIR: "_site" + - name: Update deployment status + uses: glenrobson/deployments@v0.4.2 + if: always() + with: + step: finish + auto_inactive: 'false' + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} + env_url: "https://guides.iiif.io" \ No newline at end of file