Skip to content

Commit

Permalink
Merge pull request #143 from crosscite/bolognese-2.1.0
Browse files Browse the repository at this point in the history
Update to bolognese 2.1.0
  • Loading branch information
codycooperross authored Jan 9, 2024
2 parents 43cd538 + a762697 commit 1aef656
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 113 deletions.
108 changes: 0 additions & 108 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,111 +39,3 @@ jobs:
run: |
# Run the tests in subsets instead of all at once.
bundle exec rspec spec
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

deploy:
needs: [test, build]
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Extract variables
shell: bash
run: |
echo "::set-output name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
echo "::set-output name=TAG::$(git tag --points-at HEAD)"
echo "::set-output name=GIT_SHA::$(git rev-parse HEAD)"
echo "::set-output name=GIT_SHA_SHORT::$(git rev-parse --short HEAD)"
echo "::set-output name=MESSAGE::$(git log --format=%B -n 1 ${{ github.event.after }})"
id: extract_variables

- name: Checkout terraform config repo
uses: actions/checkout@v3
with:
# public repo with terraform configuration
repository: 'datacite/mastino'
persist-credentials: false
- name: Commit changes to terraform config repository
# use go template in terraform config repository to update git sha and tag
# commit and push changes to trigger terraform workflow
run: |
export GIT_SHA=${{ steps.extract_variables.outputs.GIT_SHA_SHORT }}
export GIT_TAG=${{ steps.extract_variables.outputs.GIT_TAG }}
wget https://github.com/jwilder/dockerize/releases/download/v0.6.0/dockerize-linux-amd64-v0.6.0.tar.gz
tar -xzvf dockerize-linux-amd64-v0.6.0.tar.gz
rm dockerize-linux-amd64-v0.6.0.tar.gz
./dockerize -template stage/services/content-negotiation/_content-negotiation.auto.tfvars.tmpl:stage/services/content-negotiation/_content-negotiation.auto.tfvars
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add stage/services/content-negotiation/_content-negotiation.auto.tfvars
git commit -m "Adding content-negotiation git variables for commit ${{ steps.extract_variables.outputs.GIT_SHA }}"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: 'datacite/mastino'
branch: 'refs/heads/master'
tags: false

# - name: Notify Slack
# uses: edge/simple-slack-notify@master
# with:
# channel: '#ops'
# color: 'good'
# text: 'A new version of the <https://api.stage.datacite.org|REST API> is been deployed to stage.'
# failure_text: '${env.GITHUB_WORKFLOW} (${env.GITHUB_RUN_NUMBER}) build failed'
# fields: |
# [{ "title": "Commit message", "value": "${{ steps.extract_variables.outputs.MESSAGE }}" },
# { "title": "Committed by", "value": "<https://github.com/${{ github.repository }}/commits?author=${{ github.actor }}|${{ github.actor }}>", "short": true },
# { "title": "Commit SHA", "value": "<https://github.com/${{ github.repository }}/commit/${{ steps.extract_variables.outputs.GIT_SHA }}|${{ steps.extract_variables.outputs.GIT_SHA_SHORT }}>", "short": true },
# { "title": "Repository", "value": "<https://github.com/${{ github.repository }}|${{ github.repository }}>", "short": true },
# { "title": "Branch", "value": "<https://github.com/${{ github.repository }}/tree/${{ steps.extract_variables.outputs.BRANCH }}|${{ steps.extract_variables.outputs.BRANCH }}>", "short": true }]
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem "iso8601", "~> 0.9.0"
gem "maremma", '>= 4.9.4', '< 5'
gem 'addressable', '2.8.1'
gem "faraday", "~> 0.17.3"
gem "bolognese", "2.0.3"
gem "bolognese", "2.1.0"
gem "json-ld-preloaded", "~> 3.1", ">= 3.1.3"
gem "dalli", "~> 2.7.6"
gem "lograge", "~> 0.11.2"
Expand Down
9 changes: 5 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bibtex-ruby (6.0.0)
bibtex-ruby (6.1.0)
latex-decode (~> 0.0)
racc (~> 1.7)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bolognese (2.0.3)
bolognese (2.1.0)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down Expand Up @@ -377,7 +378,7 @@ DEPENDENCIES
addressable (= 2.8.1)
better_errors
binding_of_caller
bolognese (= 2.0.3)
bolognese (= 2.1.0)
byebug
capybara
dalli (~> 2.7.6)
Expand Down Expand Up @@ -411,4 +412,4 @@ DEPENDENCIES
webmock (~> 3.8, >= 3.8.2)

BUNDLED WITH
2.4.10
2.4.22

0 comments on commit 1aef656

Please sign in to comment.