Simplify build, invalidate cache after upload

Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
This commit is contained in:
Stefan Scherer 2020-03-11 09:55:09 +01:00
parent 3b635b1996
commit 6f31cb331c
No known key found for this signature in database
GPG Key ID: 505AF50C5D02E697
1 changed files with 7 additions and 5 deletions

View File

@ -9,13 +9,15 @@ jobs:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: '1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: print docker info
run: docker version && docker info
- uses: actions/checkout@v2
- name: build image
run: docker build --build-arg=ENABLE_ARCHIVES=true --target=current -t documentation:latest .
- name: copy static files locally
run: docker run -v ${PWD}:/output documentation:latest cp -r /usr/share/nginx/html /output/_site
- name: build current docs
run: docker build --build-arg=ENABLE_ARCHIVES=true --target=deploy-source --output=./_site .
- name: upload files to S3 bucket
run: aws s3 sync _site s3://docs.docker.com-test-us-east-1/ --delete
run: aws s3 sync --acl public-read _site s3://docs.docker.com-test-us-east-1/ --delete
- name: invalidate docs website cache
run: aws --region us-east-1 lambda invoke --function-name arn:aws:lambda:us-east-1:710015040892:function:docs-test-cache-invalidator response.json