Update dependency hashicorp/terraform to v1.9.2 #106
Workflow file for this run
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
###################################################################### | ||
# Workflow that zip, uploads artifact and notify SNS to start pipeline. | ||
# trigger build, and againand again, and again. | ||
###################################################################### | ||
name: 'Docs' | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/docs.yml' | ||
- 'apps/docs/**' | ||
jobs: | ||
terraform: | ||
defaults: | ||
run: | ||
working-directory: ./apps/docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set outputs | ||
id: vars | ||
shell: bash | ||
run: | | ||
echo "::set-output name=application::docs" | ||
echo "::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/})" | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- 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 }} | ||
- name: Zip And Upload Folder | ||
id: zip_and_upload | ||
shell: bash | ||
run: | | ||
ARTIFACT_FILENAME=${{ steps.vars.outputs.application }}-${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}.zip | ||
S3_FILENAME=s3://${{ secrets.AWS_BUCKET }}/$ARTIFACT_FILENAME | ||
zip -r $ARTIFACT_FILENAME terraform | ||
aws s3 cp $ARTIFACT_FILENAME $S3_FILENAME | ||
echo "::set-output name=s3_filename::$S3_FILENAME" | ||
echo "::set-output name=artifact_filename::$ARTIFACT_FILENAME" | ||
- name: Uploaded file | ||
run: | | ||
echo ${{ steps.zip_and_upload.outputs.s3_filename }} | ||
echo ${{ steps.zip_and_upload.outputs.artifact_filename }} | ||
- name: Publish SNS Topic | ||
uses: nothingalike/[email protected] | ||
with: | ||
TOPIC_ARN: ${{ secrets.TOPIC_ARN }} | ||
MESSAGE: | | ||
{ | ||
"reference":"${{ steps.zip_and_upload.outputs.s3_filename }}", | ||
"name": "${{ steps.vars.outputs.application }}", | ||
"commit": "${{ steps.vars.outputs.sha_short }}", | ||
"branch": "${{ steps.vars.outputs.branch }}", | ||
} | ||
docs: | ||
defaults: | ||
run: | ||
working-directory: ./apps/docs/docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set outputs | ||
id: vars | ||
shell: bash | ||
run: | | ||
echo "::set-output name=application::docs" | ||
echo "::set-output name=branch::$(echo ${GITHUB_REF#refs/heads/})" | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- uses: actions/checkout@v2 | ||
- | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: "Build Site" | ||
run: bundle exec jekyll build | ||
env: | ||
JEKYLL_ENV: productions | ||
- 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 }} | ||
- name: Sync documentation. | ||
shell: bash | ||
run: | | ||
aws s3 sync ./_site \ | ||
s3://198596758466-docs/${{ steps.vars.outputs.application }}/${{ steps.vars.outputs.branch }} \ | ||
--acl public-read \ | ||
--delete |