From aa4c1c6734f39331c2eb215d0ca3a9fbb5792510 Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 31 Jul 2023 19:19:14 +0500 Subject: [PATCH 1/2] updating to use latest glossarist --- isotc211-glossary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isotc211-glossary b/isotc211-glossary index 1e9a29d..ea6b70f 160000 --- a/isotc211-glossary +++ b/isotc211-glossary @@ -1 +1 @@ -Subproject commit 1e9a29d483c4f720606535c3f13502ad9001fdfa +Subproject commit ea6b70fb8e4323194f66843fb2da5f80b0b15e94 From 2014486d0b8cc1865a87577bfe56263720d7f54e Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 31 Jul 2023 19:45:59 +0500 Subject: [PATCH 2/2] updated workflow for deployment --- .github/workflows/build.yml | 70 ++++++++++------------------ .github/workflows/deploy-master.yml | 60 ------------------------ .github/workflows/deploy-staging.yml | 58 ----------------------- 3 files changed, 25 insertions(+), 163 deletions(-) delete mode 100644 .github/workflows/deploy-master.yml delete mode 100644 .github/workflows/deploy-staging.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9eae958..981df33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,51 +1,31 @@ -name: build +name: deploy on: push: branches: - - '*' # matches every branch - - '*/*' # matches every branch containing a single '/' - - '!master' # excludes master - - '!staging' # excludes master + - main + - staging + pull_request: + repository_dispatch: + types: + - deploy jobs: - build: - name: Build site - runs-on: ubuntu-latest - steps: - - name: Setup prerequisites - run: | - sudo apt-get update - sudo apt-get install -y curl make libxml2-dev libxslt-dev openssl - - name: Setup snaps - run: | - sudo snap install yq - sudo snap install aws-cli --classic - sudo snap install node --classic --channel=10/stable - - name: Use Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: '10.x' - - uses: actions/checkout@v2 - - name: Setup git submodules (authenticated) - env: - GLOSSARY_DEPLOY_KEY: ${{ secrets.GLOSSARY_DEPLOY_KEY }} - GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" - run: | - eval "$(ssh-agent -s)" - ssh-add - <<< "${GLOSSARY_DEPLOY_KEY}" - make update-init update-modules - - name: Update gems - run: | - gem install bundler -v "~> 2" - bundle install --jobs 4 --retry 3 - - name: Setup npm - run: | - npm install - - name: Build site - run: | - make _site + build-deploy: + uses: geolexica/ci/.github/workflows/site-deploy.yml@main + with: + ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || github.ref }} + repository: geolexica/isotc211-glossary + concepts-path: isotc211-glossary + breviter-repository: geolexica/breviter + breviter-path: breviter + production-branch: refs/heads/main + staging-branch: refs/heads/staging + production-url: https://isotc211.geolexica.org + staging-url: https://isotc211-staging.geolexica.org + secrets: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + aws-cf-distribution-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} + aws-s3-bucket-name: ${{ secrets.S3_BUCKET_NAME }} diff --git a/.github/workflows/deploy-master.yml b/.github/workflows/deploy-master.yml deleted file mode 100644 index 4e1f736..0000000 --- a/.github/workflows/deploy-master.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: deploy-master - -on: - push: - branches: master - -jobs: - build: - name: Build site - runs-on: ubuntu-latest - steps: - - name: Setup prerequisites - run: | - sudo apt-get update - sudo apt-get install -y curl make libxml2-dev libxslt-dev openssl - - name: Setup snaps - run: | - sudo snap install yq - sudo snap install aws-cli --classic - sudo snap install node --classic --channel=10/stable - - name: Use Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: '10.x' - - uses: actions/checkout@v2 - - name: Setup git submodules (authenticated) - env: - GLOSSARY_DEPLOY_KEY: ${{ secrets.GLOSSARY_DEPLOY_KEY }} - GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" - run: | - eval "$(ssh-agent -s)" - ssh-add - <<< "${GLOSSARY_DEPLOY_KEY}" - make update-init update-modules - - name: Update gems - run: | - gem install bundler -v "~> 2" - bundle install --jobs 4 --retry 3 - - name: Setup npm - run: | - npm install - - name: Build site - env: - JEKYLL_ENV: production - run: | - make all - - - - name: Deploy to geolexica.org - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} - S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} - run: | - rake geolexica:s3_deploy diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml deleted file mode 100644 index 0bff21b..0000000 --- a/.github/workflows/deploy-staging.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: deploy-staging - -on: - push: - branches: staging - -jobs: - build: - name: Build site - runs-on: ubuntu-latest - steps: - - name: Setup prerequisites - run: | - sudo apt-get update - sudo apt-get install -y curl make libxml2-dev libxslt-dev openssl - - name: Setup snaps - run: | - sudo snap install yq - sudo snap install aws-cli --classic - sudo snap install node --classic --channel=10/stable - - name: Use Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - name: Use Node - uses: actions/setup-node@v1 - with: - node-version: '10.x' - - uses: actions/checkout@v2 - - name: Setup git submodules (authenticated) - env: - GLOSSARY_DEPLOY_KEY: ${{ secrets.GLOSSARY_DEPLOY_KEY }} - GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no" - run: | - eval "$(ssh-agent -s)" - ssh-add - <<< "${GLOSSARY_DEPLOY_KEY}" - make update-init update-modules - - name: Update gems - run: | - gem install bundler -v "~> 2" - bundle install --jobs 4 --retry 3 - - name: Setup npm - run: | - npm install - - name: Build site - run: | - make all - - - - name: Deploy to geolexica.org - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_STAGING }} - S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_STAGING }} - run: | - rake geolexica:s3_deploy