From 75cb114327fc7115ba85c85c847d23ee53850020 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 6 May 2022 17:50:15 +0200 Subject: [PATCH] ci: update github actions accordingly to the new dockerfile Signed-off-by: CrazyMax --- .github/workflows/build-master.yml | 44 ++++++++++++------------ .github/workflows/build-pr.yml | 42 ++++++++++++----------- .github/workflows/build-published.yml | 48 +++++++++++++++------------ 3 files changed, 71 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index 6a8252179c..fa8d9079ed 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -6,25 +6,27 @@ on: - master jobs: - build-static-page: - name: build - runs-on: ubuntu-18.04 - timeout-minutes: 10 - env: - DOCKER_BUILDKIT: '1' + build: + runs-on: ubuntu-20.04 + if: github.repository == 'docker/docker.github.io' steps: - - name: print docker info - run: docker version && docker info - - uses: actions/checkout@v2 - - name: build current docs - run: docker build --target=deploy-source --output=./_site . - - name: upload files to S3 bucket - run: aws s3 sync --acl public-read _site s3://docs.docker.com-stage-us-east-1/ --delete + - + name: Checkout + uses: actions/checkout@v2 + - + name: Build + uses: docker/bake-action@v2 + with: + targets: release + - + name: Upload files to S3 bucket + run: | + aws s3 sync --acl public-read _site s3://docs.docker.com-stage-us-east-1/ --delete env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: update S3 website config + - + name: Update S3 website config uses: ./.github/actions/update-website-config with: bucketName: docs.docker.com-stage-us-east-1 @@ -33,16 +35,16 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: invalidate docs website cache - run: aws --region us-east-1 lambda invoke --function-name arn:aws:lambda:us-east-1:710015040892:function:docs-stage-cache-invalidator response.json + - + name: Invalidate docs website cache + run: | + aws --region us-east-1 lambda invoke --function-name arn:aws:lambda:us-east-1:710015040892:function:docs-stage-cache-invalidator response.json env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: send slack notification + - + name: Send Slack notification run: | curl -X POST -H 'Content-type: application/json' --data '{"text":"Successfully promoted docs-stage from master. https://docs-stage.docker.com/"}' $SLACK env: SLACK: ${{ secrets.SLACK_WEBHOOK }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 56408735c6..e5f5e84cd0 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -3,29 +3,31 @@ name: build docker image when PR is opened on: pull_request jobs: - build-static-page: - name: build - runs-on: ubuntu-18.04 - env: - DOCKER_BUILDKIT: '1' + build: + runs-on: ubuntu-20.04 steps: - - name: print docker info - run: docker version && docker info - - uses: actions/checkout@v2 - - name: build image - run: docker build --target=current -t documentation:latest . + - + name: Checkout + uses: actions/checkout@v2 + - + name: Build + uses: docker/bake-action@v2 + with: + targets: release + validate: - name: validate links - runs-on: ubuntu-18.04 - env: - DOCKER_BUILDKIT: '1' + runs-on: ubuntu-20.04 steps: - - name: print docker info - run: docker version && docker info - - uses: actions/checkout@v2 - - name: copy files to host - run: docker build --target=deploy-source --output=./_site . - - name: check for broken links + - + name: Checkout + uses: actions/checkout@v2 + - + name: Build + uses: docker/bake-action@v2 + with: + targets: release + - + name: Check for broken links uses: chabad360/htmlproofer@master with: directory: ./_site diff --git a/.github/workflows/build-published.yml b/.github/workflows/build-published.yml index 7c330c582c..b5fd6a84e4 100644 --- a/.github/workflows/build-published.yml +++ b/.github/workflows/build-published.yml @@ -6,25 +6,29 @@ on: - published jobs: - build-static-page: - name: build - runs-on: ubuntu-18.04 - timeout-minutes: 10 - env: - DOCKER_BUILDKIT: '1' + build: + runs-on: ubuntu-20.04 + if: github.repository == 'docker/docker.github.io' steps: - - name: print docker info - run: docker version && docker info - - uses: actions/checkout@v2 - - name: build current docs - run: docker build --build-arg JEKYLL_ENV=production --target=deploy-source --output=./_site . - - name: upload files to S3 bucket - run: aws s3 sync --acl public-read _site s3://docs.docker.com-us-east-1/ --delete + - + name: Checkout + uses: actions/checkout@v2 + - + name: Build + uses: docker/bake-action@v2 + with: + targets: release + env: + JEKYLL_ENV: production + - + name: Upload files to S3 bucket + run: | + aws s3 sync --acl public-read _site s3://docs.docker.com-us-east-1/ --delete env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: update S3 website config + - + name: Update S3 website config uses: ./.github/actions/update-website-config with: bucketName: docs.docker.com-us-east-1 @@ -32,17 +36,17 @@ jobs: websiteConfig: _website-config-docs.json env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: invalidate docs website cache - run: aws --region us-east-1 lambda invoke --function-name arn:aws:lambda:us-east-1:710015040892:function:docs-cache-invalidator response.json + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + - + name: Invalidate docs website cache + run: | + aws --region us-east-1 lambda invoke --function-name arn:aws:lambda:us-east-1:710015040892:function:docs-cache-invalidator response.json env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push' - - name: send slack notification + - + name: Send Slack notification run: | curl -X POST -H 'Content-type: application/json' --data '{"text":"Successfully published docs. https://docs.docker.com/"}' $SLACK env: SLACK: ${{ secrets.SLACK_WEBHOOK }} - if: github.repository == 'docker/docker.github.io' && github.event_name == 'push'