diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index dae2fe9..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: build - -on: - push: - branches: [ main, staging ] - pull_request: - repository_dispatch: - -jobs: - build: - name: Build site - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.1 - bundler-cache: true - - uses: actions/setup-node@v2 - with: - node-version: '14' - cache: 'npm' - - run: npm install - - name: Build site - env: - JEKYLL_ENV: production - run: make all - - name: Upload site - uses: actions/upload-artifact@v3 - with: - name: site - path: _site - retention-days: 1 - - deploy: - name: Deploy site - needs: build - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging' }} - environment: - name: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }} - url: ${{ github.ref == 'refs/heads/main' && 'https://registry.isotc211.org' || 'https://staging-registry.isotc211.org' }} - steps: - - name: Download site - uses: actions/download-artifact@v3 - with: - name: site - path: _site - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} - - - run: 'ls -al' - - - name: Deploy to AWS - env: - CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} - S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} - run: | - aws configure set default.s3.max_concurrent_requests 100 - aws configure set default.s3.max_queue_size 10000 - # aws configure set default.s3.use_accelerate_endpoint true - aws configure set default.s3.payload_signing_enabled false - aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*" --include "*.html" --content-type "text/html; charset=utf-8" - aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*" --include "*.json" --content-type "text/json; charset=utf-8" - aws s3 sync _site s3://$S3_BUCKET_NAME --region=$AWS_REGION --delete --no-progress --exclude "*.html,*.json" --include "*" - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*" diff --git a/.github/workflows/build_deploy.yml b/.github/workflows/build_deploy.yml new file mode 100644 index 0000000..cb21056 --- /dev/null +++ b/.github/workflows/build_deploy.yml @@ -0,0 +1,71 @@ +name: build_deploy + +on: + push: + branches: + - main + # - staging + pull_request: + repository_dispatch: + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + # needs: [set_environment] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 # Increment this number if you need to re-download cached gems + + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' + + - run: npm install + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + + - name: Build site + env: + JEKYLL_ENV: production + run: make all + + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 0000000..94bd576 --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,55 @@ +name: links + +on: + push: + branches: + - main + - staging + pull_request: + +jobs: + link_checker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + cache-version: 0 # Increment this number if you need to re-download cached gems + + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' + + - run: npm install + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + + - name: Link Checker + uses: lycheeverse/lychee-action@v1.2.0 + with: + args: --verbose --no-progress --exclude-file .lycheeignore -- _site/**/*.html + fail: true + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + # - name: Create Issue From File + # uses: peter-evans/create-issue-from-file@v2 + # with: + # title: Link Checker Report + # content-filepath: ./lychee/out.md + # labels: report, automated issue diff --git a/.gitignore b/.gitignore index c9bd121..ffe0f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .sass-cache _site build_source/* +Gemfile.lock \ No newline at end of file