summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorShane McDonald <me@shanemcd.com>2021-07-19 18:31:47 +0200
committerShane McDonald <me@shanemcd.com>2021-07-20 18:23:05 +0200
commitaa934b1ddaf39122f690de774f8ddf61f4c225ec (patch)
tree5cbd0f35e1e24f41d2de9d34028cd05f7367cc97 /.github/workflows
parentSet maxworkers to 4 (diff)
downloadawx-aa934b1ddaf39122f690de774f8ddf61f4c225ec.tar.xz
awx-aa934b1ddaf39122f690de774f8ddf61f4c225ec.zip
Add post-merge GHA job for uploading api schema to s3
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/upload_schema.yml41
1 files changed, 41 insertions, 0 deletions
diff --git a/.github/workflows/upload_schema.yml b/.github/workflows/upload_schema.yml
new file mode 100644
index 0000000000..2806739d27
--- /dev/null
+++ b/.github/workflows/upload_schema.yml
@@ -0,0 +1,41 @@
+---
+name: Upload API Schema
+on:
+ push:
+ branches:
+ - devel
+jobs:
+ push:
+ runs-on: ubuntu-latest
+ permissions:
+ packages: write
+ contents: read
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Log in to registry
+ run: |
+ echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+
+ - name: Pre-pull image to warm build cache
+ run: |
+ docker pull ghcr.io/${{ github.repository_owner }}/awx_devel:${GITHUB_REF##*/}
+
+ - name: Build image
+ run: |
+ DEV_DOCKER_TAG_BASE=ghcr.io/${{ github.repository_owner }} COMPOSE_TAG=${GITHUB_REF##*/} make docker-compose-build
+
+ - name: Generate API Schema
+ run: |
+ docker run -u $(id -u) --rm -v ${{ github.workspace }}:/awx_devel/:Z \
+ --workdir=/awx_devel ghcr.io/${{ github.repository_owner }}/awx_devel:${{ github.base_ref }} /start_tests.sh genschema
+
+ - name: Upload API Schema
+ env:
+ AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
+ AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
+ run: |
+ ansible localhost -c local -m aws_s3 \
+ -a 'src=${{ github.workspace }}/schema.json bucket=awx-public-ci-files object=schema.json mode=put permission=public-read'
+
+