Update default versions #5
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
name: cd | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | |
- name: setup python | |
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4 | |
with: | |
python-version: "3.8" | |
- name: install | |
run: pip install .[dev] | |
- name: build package | |
run: python setup.py bdist_wheel | |
- name: build docker image | |
run: docker build . --tag gravitational/aws-quota-checker:test | |
build_and_push_docker_image: | |
runs-on: ubuntu-latest | |
needs: [test] | |
name: Build and push Docker image | |
env: | |
AWS_ROLE: arn:aws:iam::146628656107:role/aws-quota-checker-github-action-ecr-role | |
steps: | |
- name: checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | |
- name: setup docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: build docker image | |
run: docker build . --tag gravitational/aws-quota-checker:staged | |
- name: configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4 | |
with: | |
aws-region: ${{ env.AWS_REGION }} | |
role-to-assume: ${{ env.AWS_ROLE }} | |
- name: login to ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v1 | |
with: | |
registry-type: public | |
- name: export ECR Repository | |
run: | | |
echo "ECR_REPOSITORY=${{ steps.login-ecr.outputs.registry }}" >> $GITHUB_ENV | |
- name: push docker image | |
run: | | |
docker tag gravitational/aws-quota-checker:staged ${ECR_REPOSITORY}/gravitational/aws-quota-checker:${GITHUB_REF##*/} | |
docker push ${ECR_REPOSITORY}/gravitational/aws-quota-checker:${GITHUB_REF##*/} |