Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test action #4698

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 63 additions & 50 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,57 +32,70 @@ jobs:
fi
echo "::set-env name=BUCKET::$BUCKET"
echo "::set-env name=HOSTNAME::$HOSTNAME"
- name: Pull image
run: docker pull mesosphere/docs:latest
- name: Build image
run: |
cp docker/Dockerfile.production.dockerignore .dockerignore
docker build --cache-from mesosphere/docs:latest -f docker/Dockerfile.production -t mesosphere/docs:latest .
# - name: Pull image
# run: docker pull mesosphere/docs:latest
# - name: Build image
# run: |
# cp docker/Dockerfile.production.dockerignore .dockerignore
# docker build --cache-from mesosphere/docs:latest -f docker/Dockerfile.production -t mesosphere/docs:latest .
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1-node16
# with:
# role-to-assume: ${{ secrets.AWS_DOCS_SITE_ROLE }}
# aws-region: us-west-2
# - name: Build & Deploy Preview Docs
# run: |
# docker run \
# -v "$PWD/pages":/src/pages \
# -e ALGOLIA_PRIVATE_KEY=$ALGOLIA_PRIVATE_KEY \
# -e ALGOLIA_UPDATE="" \
# -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
# -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
# -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
# -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
# -e BUCKET=${{ env.BUCKET }} \
# -e PRINCIPAL=${{ secrets.AWS_DOCS_SITE_ROLE }} \
# -e REDIR_HOSTNAME=${{ env.HOSTNAME }} \
# -e DOCS_ENV="preview" \
# mesosphere/docs /src/ci/deploy.sh
# echo "http://${{ env.HOSTNAME }}"
# shell: bash
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_DOCS_SITE_ROLE }}
aws-region: us-west-2
- name: Build & Deploy Preview Docs
run: |
docker run \
-v "$PWD/pages":/src/pages \
-e ALGOLIA_PRIVATE_KEY=$ALGOLIA_PRIVATE_KEY \
-e ALGOLIA_UPDATE="" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
-e BUCKET=${{ env.BUCKET }} \
-e PRINCIPAL=${{ secrets.AWS_DOCS_SITE_ROLE }} \
-e REDIR_HOSTNAME=${{ env.HOSTNAME }} \
-e DOCS_ENV="preview" \
mesosphere/docs /src/ci/deploy.sh
echo "http://${{ env.HOSTNAME }}"
shell: bash
- name: Build & Deploy Main Docs
role-to-assume: arn:aws:iam::139475575661:role/dcos-docs-site
aws-region: us-west-2
- name: Create File
run: |
mkdir ./test
touch ./test/hello-world.txt
echo "hello world" > ./test/hello-world.txt
- name: Copy files to the test website with the AWS CLI
run: |
docker run \
-v "$PWD/pages":/src/pages \
-e ALGOLIA_PRIVATE_KEY=$ALGOLIA_PRIVATE_KEY \
-e ALGOLIA_UPDATE="true" \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
-e BUCKET=docs-d2iq-com-production \
-e PRINCIPAL="arn:aws:iam::977260619897:role/dcos-docs-site" \
-e REDIR_HOSTNAME="archive-docs.d2iq.com" \
-e DOCS_ENV="production" \
mesosphere/docs /src/ci/deploy.sh
echo "http://archive-docs.d2iq.com"
shell: bash
- name: Push Image and Restart Server
run: |
if [ "$BRANCH" = "main" ]; then
docker push mesosphere/docs:latest
kubectl -n docs-site rollout restart deployment docs-site-dev
kubectl -n docs-site rollout status deploy/docs-site-dev -w --timeout=10m
fi
shell: bash
aws s3 sync ./test s3://docs-d2iq-com-pr-4698
# - name: Build & Deploy Main Docs
# run: |
# docker run \
# -v "$PWD/pages":/src/pages \
# -e ALGOLIA_PRIVATE_KEY=$ALGOLIA_PRIVATE_KEY \
# -e ALGOLIA_UPDATE="true" \
# -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
# -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
# -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
# -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
# -e BUCKET=docs-d2iq-com-production \
# -e PRINCIPAL="arn:aws:iam::977260619897:role/dcos-docs-site" \
# -e REDIR_HOSTNAME="archive-docs.d2iq.com" \
# -e DOCS_ENV="production" \
# mesosphere/docs /src/ci/deploy.sh
# echo "http://archive-docs.d2iq.com"
# shell: bash
# - name: Push Image and Restart Server
# run: |
# if [ "$BRANCH" = "main" ]; then
# docker push mesosphere/docs:latest
# kubectl -n docs-site rollout restart deployment docs-site-dev
# kubectl -n docs-site rollout status deploy/docs-site-dev -w --timeout=10m
# fi
# shell: bash