Merge branch 'beta-test' into dev #246
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: Deploy Dev | |
on: | |
push: | |
branches: | |
- "dev" | |
paths-ignore: | |
- '**README.md' | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
S3_BUCKET: ${{ secrets.S3_BUCKET_DEV }} | |
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Extract branch name | |
shell: bash | |
run: | | |
echo "::set-output name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" | |
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: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: '0.101.0' | |
extended: true | |
- name: Build | |
run: | | |
cp dev.toml config.toml | |
hugo -v --minify | |
- name: Deploy | |
uses: reggionick/s3-deploy@v3 | |
with: | |
folder: public | |
bucket: ${{ secrets.S3_BUCKET_DEV }} | |
bucket-region: ${{ secrets.S3_BUCKET_REGION }} | |
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_DEV }} | |
invalidation: /* | |
delete-removed: true | |
- name: Notify Slack | |
if: always() | |
uses: edge/simple-slack-notify@master | |
with: | |
channel: '#website-updates' | |
color: 'good' | |
text: 'Copying new content to server <https://dev.ror.org|dev.ror.org>...' | |
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/ror-community/ror-site/commits?author=${{ github.actor }}|${{ github.actor }}>", "short": true }, | |
{ "title": "Commit SHA", "value": "<https://github.com/ror-community/ror-site/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/ror-community/ror-site/tree/${{ steps.extract_variables.outputs.BRANCH }}|${{ steps.extract_variables.outputs.BRANCH }}>", "short": true }] |