Fixes to get github workflows running #262
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: Testing | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/testing.yaml | |
- Gemfile | |
- Gemfile.lock | |
- config.rb | |
- data/** | |
- helpers/** | |
- source/** | |
issue_comment: | |
types: [created] | |
env: | |
ENV: test | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
#TODO: bring this back to 2.7 | |
ruby-version: '2.6' | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- run: echo $ENV | |
- name: Attempt to build the static site | |
run: bundle exec middleman build --bail | |
- name: Push the static site to stage | |
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/push') | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} | |
STAGE_S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} | |
run: aws s3 sync build $STAGE_S3_BUCKET/build/ | |
- uses: actions/[email protected] | |
name: comment-on-pr | |
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/push') && ! failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: "Deployed to stage!" | |
}); |